F. Senault
1/19/2007 1:05:00 PM
Le 19 janvier 2007 à 10:19, Hu Ma a écrit :
> Hello,
> I have a Ruby aplication that deals with non-english text and I want to
> transform some of that text to [^a-zA-Z0-9].
You could try with Iconv to convert from your encoding to ASCII. Quick
example :
>> require "iconv"
=> true
>> Iconv.iconv("ascii//translit", "iso-8859-1", "aéioù")
=> ["a'eio`u"]
>> Iconv.iconv("ascii//translit", "iso-8859-1", "aéiou")[0].tr('^a-z', '')
=> "aeiou"
Fred
--
Can you see your days blighted by darkness ?
Is it true you beat your fists on the floor ?
Stuck in a world of isolation
While the ivy grows over the door (Pink Floyd, Lost For Words)