http://qs321.pair.com?node_id=731944


in reply to Pragma to handle unicode characters

I guess
use encoding 'utf8';
does what you want. The pragma change also the PerIO layer for STDIN and STDOUT.
Boris

Replies are listed 'Best First'.
Re^2: Pragma to handle unicode characters
by ikegami (Patriarch) on Dec 22, 2008 at 01:34 UTC
    The encoding pragma has issues, so I avoid it. Use of the utf8 and open pragmas is more suitable.
Re^2: Pragma to handle unicode characters
by wanradt (Scribe) on Dec 22, 2008 at 01:01 UTC

    I tried it, but there are other worries, warnings "Wide character in print at" and @ARGV is still not treated as UTF-8 chars, uc() does not recognize them as chars

    And perldoc utf8 says

    In case you are wondering: yes, "use encoding ’utf8’;" works much the same as "use utf8;".

    In perl58delta i read also:

    New Unicode Semantics (no more use utf8, almost)

    Previously in Perl 5.6 to use Unicode one would say "use utf8" and then the operations (like string concatenation) were Unicode-aware in that lexical scope.
    So i could not even use "use utf8", theoretically ;)

    Nġnda, WK