Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^3: Different behaviour in characters in string vs. array?

by ccn (Vicar)
on Dec 10, 2008 at 21:45 UTC ( [id://729518]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Different behaviour in characters in string vs. array?
in thread Different behaviour in characters in string vs. array?

Good point.

So to avoid encoding bugs and warnings at output about "Wide character in print" one can write:

use utf8; $ENV{LANG} = 'ru_RU.UTF-8'; use open IO => ':locale'; # I tried ':utf8' instead but got warnings

Replies are listed 'Best First'.
Re^4: Different behaviour in characters in string vs. array?
by ikegami (Patriarch) on Dec 10, 2008 at 22:48 UTC

    The bugs to which you linked are Encode's, not encoding. While they may effect use encoding, I was referring to use encoding's proper flaws. Now, I can't remember exactly what they were, but you can search the P5P mailing list for the conversation.

    Depending on what you want to do,

    # Use expected encoding for STDIN/OUT/ERR use open ':std', ':locale'; # Use UTF-8 for STDIN/OUT/ERR use open ':std', ':encoding(UTF-8)'; # Use UTF-8 for file IO use open IO => ':encoding(UTF-8)';

    :utf8 has a security vulnerability for input.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2024-04-24 16:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found