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.