Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re: problems matching umlauts in env vars

by borisz (Canon)
on Jul 23, 2004 at 01:43 UTC ( #376772=note: print w/replies, xml ) Need Help??

in reply to problems matching umlauts in env vars

Your problem is IMHO, that you locale is already in utf8. This means that your env var is in utf8 but your $testString is in latin1. If this is the case you need to use Encode;. And update the bytes from your environment to utf.
$fileAsked = Encode::decode(utf8 => $ENV{'aa'});

Replies are listed 'Best First'.
Re^2: problems matching umlauts in env vars
by december (Pilgrim) on Jul 23, 2004 at 04:31 UTC

    It's not in utf. When I encode it like you told me, it can't find the file anymore (the now changed to an utf sequence when I print the variable, and the filesystem doesn't like utf filenames). Both strings seem to be iso-8859-1, probably just plain 8bit. When I update it to utf, though, it's the DOT it doesn't want to match on - not the umlaut.

    /^([\w\s.]+)$/ # unescaped /^([\w\s\.]+)$/ # or escaped

    Is there something wrong with the dot in the regex?

      No, inside the [] a . is the same as \.
        I believe Boris means: "No, inside the [] a . is the same as \.", but his square brackets got eaten by a moose and a squirrel not using code tags.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://376772]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2022-05-22 20:09 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (81 votes). Check out past polls.