Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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 lurking in the Monastery: (12)
As of 2015-07-31 20:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (281 votes), past polls