From: Stefan Schmiedl Date: 2007-03-04T04:50:12+09:00 Subject: Re: ruby, irb and iconv with translit On Sat, 03 Mar 2007 18:47:44 +0100, Stefan Schmiedl wrote: >> >> I've been trying to find out why sorting a list of German names failed >> on both my local Gentoo box and my remote Debian server. Can somebody >> please explain the following in simple words? >> The folks at #ruby-de helped me out with some brain waves and the problem originates with locale settings. To wit: $ echo ��rger | LC_CTYPE=de iconv -f utf8 -t ascii//translit ?rger $ echo ��rger | LC_CTYPE=de_DE iconv -f utf8 -t ascii//translit AErger But while you can get the iconv tool to behave by setting LC_CTYPE, there's no such luck with ruby: $ LC_CTYPE=C ruby test.rb "?rger" $ LC_CTYPE=de_DE ruby test.rb "?rger" For the record, test.rb (saved as utf8) looks like: $KCODE='u' require "iconv" $conv = Iconv.new("ASCII//TRANSLIT", "UTF-8") p($conv.iconv("��rger")) s.