![]() |
|
Just another Perl shrine | |
PerlMonks |
problems matching umlauts in env varsby december (Pilgrim) |
on Jul 23, 2004 at 01:08 UTC ( #376768=perlquestion: print w/replies, xml ) | Need Help?? |
december has asked for the wisdom of the Perl Monks concerning the following question: Hello, fellow seekers of enlightenment, I'm trying to construct a simple regex that checks if a variable contains characters valid in a unix path. The regex works as it should when there are no umlauts in the string, but when testing different inputs, I noticed it refuses to match any umlauts. What bugs me, is that it does match the exact same string when I use a variable, but not when handed down by $ENV{'PATH_TRANSLATED'} - which probably is a non-encoded 8bit string. A shortened example:
prints:
Note that both strings and regex's are exactly the same, but after conversion, one matches, and the other doesn't. I suspect some utf8 problems, or a wrong charset used for \w. Perl version is 5.8.3. How do I make the \w match umlauts consistently? Do I need to set a locale even for utf8? This behavior doesn't seem logical to me.
Back to
Seekers of Perl Wisdom
|
|