From: "Shot (Piotr Szotkowski)" Date: 2008-06-30T19:25:05+09:00 Subject: Re: Difference in iconv between ruby and irb --0lnxQi9hkpPO77W3 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable edek: > I have simple script: > require 'iconv' > s =3D '=C4=85=C4=99=C5=9B=C4=87=C5=84=C5=BA' # a few polish letters with = accents > puts Iconv.iconv('ASCII//TRANSLIT', 'UTF-8', s) > I expect result like "aescnz". You need to tell Ruby you=E2=80=99re talking in UTF-8 to it in the first pl= ace. I have -Ku in my $RUBYOPT environmental variable (you can also simply=20 $KCODE =3D 'u' in your Ruby code) and I get the below: >> shot@devielle:~$ irb >> require 'iconv' =3D> true >> Iconv.iconv 'ASCII//TRANSLIT', 'UTF-8', '=C4=85=C4=87=C4=99=C5=82=C5=84= =C3=B3=C5=9B=C5=BA=C5=BC' =3D> ["acelnoszz"] BTW: =C5=81adny adres email. :) -- Shot --=20 Of course I can see iso-8859-1 characters, I'm French. -- Christian Maril= lat --0lnxQi9hkpPO77W3 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) iD8DBQFIaLafi/mCfdEo8UoRAuytAJ9PLhoo0AP2exa545a0QcZvrQybOwCeOLcJ adagI5+hGnT3YkKDOON9o0I= =7zF7 -----END PGP SIGNATURE----- --0lnxQi9hkpPO77W3--