On Feb 13, 2007, at 8:21 PM, Paul Duncan wrote:

> * Thiago Arrais (thiago.arrais / gmail.com) wrote:
>> Has anyone seen a non-english characters library for Ruby walking
>> around? For now, I need to remove letter decorators (in other words,
>> ' becomes n and ' becomes a) and drop non-alphanumeric
>> characters ('!etter' becomes 'etter').
>
> I thought iconv transliteration might do this, but it doesn't:
>
>   require 'iconv'
>   i = Iconv.new('ascii//TRANSLIT//IGNORE, 'iso-8859-1')
>   i.iconv(')
>   => "?"

Looks like your source code was not iso-8859-1, because it works:

   require 'iconv'
   puts Iconv.iconv('ascii//ignore//translit', 'iso-8859-1', ")
   => ~n

It works in UTF8 as well:

   $KCODE = 'u'
   require 'iconv'

   puts Iconv.iconv('ascii//ignore//translit', 'utf-8', ")
   => ~n

-- fxn