# Transliteration problems

**URL:** <https://rubytalk.org/t/transliteration-problems/50088>\
**Category:** ruby-talk\
**Created:** [8 November 2008 22:10 UTC](https://rubytalk.org/t/transliteration-problems/50088 "2008-11-08T22:10:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Axel\_Etzold](https://avatars.discourse-cdn.com/v4/letter/a/ba8739/32.png) [@Axel\_Etzold](https://rubytalk.org/u/Axel_Etzold)\
**Post date:** [8 November 2008 22:10 UTC](https://rubytalk.org/t/transliteration-problems/50088/1 "2008-11-08T22:10:12Z")

</div>

Dear all,

I'd like to transliterate some accented text, just removing the accents.  
The encoding should be iso-8859-1 (source and destination).

I am on Ubuntu 8.04, and I get the following:

require "rubygems"  
require "iconv"

s="caffè"  
p Iconv.iconv("ascii//translit","iso-8859-1",s)[0] =\> "caff?"

Is there any way to get "caffe" ?

I read in some earlier post to a Ruby list that there are different language locales to Iconv,  
but I couldn't find how to specify any in Ruby Iconv :

[http://groups.google.de/group/comp.lang.ruby/browse\_thread/thread/40d823813170aa9a](http://groups.google.de/group/comp.lang.ruby/browse_thread/thread/40d823813170aa9a)

Thank you very much for your help!

Best regards,

Axel

> **···**
>
> --  
> GMX Download-Spiele: Preizsturz! Alle Puzzle-Spiele Deluxe über 60% billiger.
> 
> > **[Aktuelle Nachrichten aus Politik, Wirtschaft & Panorama](https://www.gmx.net/magazine/news/)**
> >
> > News - Nachrichten, Kommentare, Interviews und Hintergründe zu nationaler und internationaler Politik, Sport und Wirtschaft sowie das aktuelle Wetter und Panorama.

---

<div class="post-metadata">

**Author:** ![Josef\_Jupp\_SCHUGT](https://avatars.discourse-cdn.com/v4/letter/j/7ba0ec/32.png) [@Josef\_Jupp\_SCHUGT](https://rubytalk.org/u/Josef_Jupp_SCHUGT)\
**Post date:** [8 November 2008 23:05 UTC](https://rubytalk.org/t/transliteration-problems/50088/2 "2008-11-08T23:05:02Z")

</div>

It seems as if either your system is broken or the file is not in ISO 8859-1 because that conversion \*should\* work and it does so on my Fedora 9:

Linux pen2.homeunix.net 2.6.26.6-79.fc9.x86\_64 #1 SMP Fri Oct 17 14:20:33 EDT 2008 x86\_64 x86\_64 x86\_64 GNU/Linux

$ iconv --version|head -1  
iconv (GNU libc) 2.8

Are you sure that you do not get "caffA?" in place of "caff?"? That would suggest that the file is encoded using utf8, not an encoding of the ISO 8859 familiy.

Josef 'Jupp' Schugt

> **···**
>
> On Sat, 08 Nov 2008 23:10:12 +0100, Axel Etzold \<AEtzold@gmx.de\> wrote:
> 
> > p Iconv.iconv("ascii//translit","iso-8859-1",s)[0] =\> "caff?"
> 
> --  
> Blog: [http://penpen.goodaddress.eu/](http://penpen.goodaddress.eu/)  
> PGP key (id 6CC6574F): [http://wwwkeys.de.pgp.net/](http://wwwkeys.de.pgp.net/)  
> Jabber - [http://www.jabber.org/](http://www.jabber.org/) - contact information on request

---

<div class="post-metadata">

**Author:** ![Henrik](https://avatars.discourse-cdn.com/v4/letter/h/ba9def/32.png) [@Henrik](https://rubytalk.org/u/Henrik)\
**Post date:** [9 November 2008 10:09 UTC](https://rubytalk.org/t/transliteration-problems/50088/3 "2008-11-09T10:09:12Z")

</div>

See if [http://groups.google.com/group/ruby-talk-google/browse\_thread/thread/96c75d3587012556](http://groups.google.com/group/ruby-talk-google/browse_thread/thread/96c75d3587012556)  
helps.

> **···**
>
> On Sun, Nov 9, 2008 at 12:05 AM, Josef 'Jupp' Schugt \<jupp@gmx.de\> wrote:
> 
> > On Sat, 08 Nov 2008 23:10:12 +0100, Axel Etzold \<AEtzold@gmx.de\> wrote:
> > 
> > > p Iconv.iconv("ascii//translit","iso-8859-1",s)[0] =\> "caff?"
> > 
> > It seems as if either your system is broken or the file is not in ISO 8859-1  
> > because that conversion \*should\* work and it does so on my Fedora 9:
> > 
> > Linux pen2.homeunix.net 2.6.26.6-79.fc9.x86\_64 #1 SMP Fri Oct 17 14:20:33  
> > EDT 2008 x86\_64 x86\_64 x86\_64 GNU/Linux
> > 
> > $ iconv --version|head -1  
> > iconv (GNU libc) 2.8
> > 
> > Are you sure that you do not get "caffA?" in place of "caff?"? That would  
> > suggest that the file is encoded using utf8, not an encoding of the ISO 8859  
> > familiy.
> > 
> > Josef 'Jupp' Schugt  
> > --  
> > Blog: [http://penpen.goodaddress.eu/](http://penpen.goodaddress.eu/)  
> > PGP key (id 6CC6574F): [http://wwwkeys.de.pgp.net/](http://wwwkeys.de.pgp.net/)  
> > Jabber - [http://www.jabber.org/](http://www.jabber.org/) - contact information on request
