in reply to Re^3: use locale behavior depends on charset of locale?
in thread use locale behavior depends on charset of locale?
And it looks like the problem is not in IO
Correct. That's what my changes show.
I don't really understand this output very well, but it looks like it treats this regexes differently.
It's not a problem that /\w/ and /[\w]/ compile differently. It's a problem that they don't compile to something equivalent.
use locale; utf8::upgrade( my $s = chr(0xC9) ); # e-acute print "Outside char class: ", $s =~ m/\w/ ? "" : "no ", "match\n"; print "Inside char class: ", $s =~ m/[\w]/ ? "" : "no ", "match\n";
LANG=en_CA.utf8 perl test.pl Outside char class: no match Inside char class: match
|
|---|