Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: Pragma to handle unicode characters

by borisz (Canon)
on Dec 22, 2008 at 00:14 UTC ( #731944=note: print w/replies, xml ) Need Help??

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.

Replies are listed 'Best First'.
Re^2: Pragma to handle unicode characters
by ikegami (Pope) 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

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2016-10-23 21:30 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (302 votes). Check out past polls.