Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: any use of 'use locale'?

by Khen1950fx (Canon)
on Nov 23, 2009 at 01:32 UTC ( #808706=note: print w/ replies, xml ) Need Help??


in reply to any use of 'use locale'?

Just some thoughts... I ran your script as is and I got the following results:

C R S ? Z R S T U V W X Y Z

The results tell me that the encoding is the special locale C which maps to ASCII, the ? mark tells you that something is missing. C maps to ASCII, but the does not. I would guess that you have to declare the locale, so I tried this:

#!/usr/bin/perl use strict; no warnings 'utf8'; use utf8; use POSIX; use locale; print setlocale(LC_CTYPE(), 'et_EE.UTF-8'), "\n\n"; my(@real) = ('R', 'S', '', 'Z'); my(@fake) = ('R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'); print "@real\n", "@fake\n";

And the results:

et_EE.UTF-8 R S Z R S T U V W X Y Z
I wasn't comfortable with the range operator, so I deleted that. Personally, I think that it might be a platform-specific problem.


Comment on Re: any use of 'use locale'?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (9)
As of 2014-12-18 12:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (51 votes), past polls