Transliteration problems

A

Axel Etzold

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

Thank you very much for your help!

Best regards,

Axel
 
J

Josef 'Jupp' Schugt

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
 
H

Henrik Nyh

See if http://groups.google.com/group/ruby-talk-google/browse_thread/thread/96c75d3587012556
helps.

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top