Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^3: Default encoding rules leave me puzzled...

by Anonymous Monk
on Jun 20, 2014 at 13:41 UTC ( #1090635=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Default encoding rules leave me puzzled...
in thread Default encoding rules leave me puzzled...

What do you mean? I'm pretty sure pack's C* takes C chars, that is, octets, bytes. At least that's what the documentation says. And 231:97 is not a valid utf-8 sequence. So in binary mode Perl encodes codepoints < 256 as Latin-1, otherwise it just spits out utf-8 as is. That's pretty crazy.

perl -CO -wE 'use utf8; say q(Franšais)' | perl -lnwE 'print join q(:) +, unpack q(C*), $_' 70:114:97:110:195:167:97:105:115


Comment on Re^3: Default encoding rules leave me puzzled...
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (9)
As of 2015-07-04 17:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls