Iconv does not work with french characters

Hello,

I am trying to convert french characters into latin ones using inconv
but I face some problems.

Here is what I am doing in ruby console:

$KCODE = ‘u’
=> “u”

@x = ‘x éèçà x’
=> “x éèçà x”

Iconv.new(‘US-ASCII//TRANSLIT’, ‘utf-8’).iconv @x
=> “x ??? x”

And I expect “x eeca x” as output.

ruby --version returns:
ruby 1.8.2 (2005-04-11) [i386-linux]

iconv --version returns:
iconv (GNU libiconv 1.11)
Copyright © 2000-2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is
NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
Written by Bruno Haible.

Maybe somebody knows where is the problem?


Best wishes,
Justas J.

Well, anyone? :slight_smile:

On 3/28/07, Justas J. [email protected] wrote:

@x = ‘x éèçà x’
=> “x éèçà x”
Iconv.new(‘US-ASCII//TRANSLIT’, ‘utf-8’).iconv @x
=> “x ??? x”

And I expect “x eeca x” as output.

I’m using ruby 1.8.6 and I get “x 'eeca x” as my result.

Wish I could help, but this is really more of a ruby question. Iconv
is a ruby standard lib.


Rick O.
http://lighthouseapp.com
http://weblog.techno-weenie.net
http://mephistoblog.com