From: "Erik Bågfors" Date: 2002-02-13T01:42:11+09:00 Subject: Re: Regexps and latin-1 On Tue, 2002-02-12 at 16:31, Damien Wyart wrote: > Dear all, > > I would need to use Ruby on text files containing latin-1 characters. I > have been a bit surprised this is not possible in plain Ruby 1.6 ! Seems > like Perl does not handle this neither (maybe recent versions ?), but > Python does, I think. > > I have tried freq.rb (in sample/) on a file with latin-1 words, and it > doesn't work. Is there a (simple) workaround in 1.6 ? In 1.7 (CVS) ? > > Any code snippets will be much apreciated. > Ehhh... Why shouldn't ruby or perl be able to handle latin-1 characters?? I use both languages with files that includes latin-1 characters alot and have never had any problems with it. ruby -e 'a="B�gfors"; a =~ /(�)/; print "#{$1}"' � seams to work for me. /Erik -- Erik B�gfors | erik@bagfors.nu Supporter of free software | GSM +46 733 279 273 fingerprint: 6666 A85B 95D3 D26B 296B 6C60 4F32 2C0B 693D 6E32