Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

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.
Boris


Comment on Re: Pragma to handle unicode characters
Download Code
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
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.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (6)
As of 2014-12-26 23:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (176 votes), past polls