Carlos wrote:
> [Russell Norris <rsl / swimcommunity.org>, 2007-09-03 00.40 CEST]
> [...]
>> Howdy. I'm working with Iconv and discovered that this code
>>
>>   require "iconv"
>>   ["is", "strae", "kierkegd", "jo", "bjk"].each do |word|
>>     puts "#{word} => #{Iconv.iconv('ascii//translit', 'utf-8', word)}"
>>   end
> [...]
>> rsl@sneaky ~ > ./omg.rb
>> is => aegis
>> stra => strasse
>> kierkegd => kierkeg?rd
>> jo => jo?o
>> bjk => bj?rk
> 
> Hi, Russell. Apparently the ASCII transliteration rules are defined in
> locale data files, and not all locales define all of them (and some that
> define it, do it differently). The resolution of this bug report explains
> the situation a little more:
> 
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=376272

Also I get different results depending on platform:

Ubuntu/iconv (GNU libc) 2.3.6:
   ruby -riconv -e 'puts Iconv.iconv("US-ASCII//TRANSLIT", "UTF-8", 
"caff\303\250")'
   => caff?

FreeBSD/iconv (GNU libiconv 1.9)
   ruby -riconv -e 'puts Iconv.iconv("US-ASCII//TRANSLIT", "UTF-8", 
"caff\303\250")'
   => caff`e

This doesn't explain why you have different results in irb and ruby, but 
it does show how unreliable Iconv translit can be. IMHO you'd be better 
off using the Unicode gem if you want to decompose UTF8 strings.

Daniel