From: 7stud -- Date: 2011-03-09T07:59:05+09:00 Subject: Re: UTF-8 support - still stuck Thomas Luedeke wrote in post #985708: > This seemed to have work in NotePad ++, set to UTF-8 and with the BOM > off: > > ====================== > > #! /bin/ruby -Kn > > #Encoding: UTF-8 > > verb = "appèler" > if( verb =~ /èler/) then print "The verb was #{verb}" end > > ====================== > > I think it was the -Kn flag, although I don't understand what that > changes. I'll look into it. Thanks for all your help! In ruby, there is a variable called $KCODE. If you set it to "UTF-8" (or just "U"), then it makes regular expressions match characters rather than single bytes. If you set $KCODE to "N" (the default), then regular expressions will match single bytes (unless you use the /u flag on your regular expression). You can set $KCODE from the command line, e.g. -Ku or -Kn. -- Posted via http://www.ruby-forum.com/.