From: eden li Date: 2007-05-14T12:50:12+09:00 Subject: Re: regex \w allows non english characters Depends on what you mean by "work." If you don't set a global $KCODE and you don't specify a language as part of the regex options, all regular expressions will work on the byte level. It appears ruby (1.8.x) only supports utf-8 if you set $KCODE = "u" or pass in a u as a regex option. >> "你好" =~ /(\w)/u and $1 => "你" >> Iconv.iconv("utf-16", "utf-8", "你好") =~ /(\w)/u and $1 => false On May 12, 3:27 am, "Kyle Schmitt" wrote: > As I said a guess ;) That's really interesting though. So had it > been for chars outside of english, I would have been on the ball... > Any chances that ruby's regex will work on utf8(or 16 or 7 or any of > the variants)?