Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^4: Default encoding rules leave me puzzled... (use open qw/ :std :locale /;

by kzwix (Sexton)
on Jun 20, 2014 at 13:08 UTC ( [id://1090622]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Default encoding rules leave me puzzled... (use open qw/ :std :locale /;
in thread Default encoding rules leave me puzzled...

I'm sorry, but I think that your "Perl tries to not convert anything at all, automatically" statement is wrong.
I mean, else, why would a string internally stored as UTF-8 be converted to Latin-1 when sent to the standard output ?
(That is, without having used any funny encoding/decoding/layer stuff...)
  • Comment on Re^4: Default encoding rules leave me puzzled... (use open qw/ :std :locale /;

Replies are listed 'Best First'.
Re^5: Default encoding rules leave me puzzled... (use open qw/ :std :locale /;
by moritz (Cardinal) on Jun 20, 2014 at 17:27 UTC

    It's your use utf8; statement that explicitly converts the source code to perl's internal format, which happens to be latin-1 in this case. The output operation then doesn't convert anything. Maybe I should have said that no implicit conversion takes place, because I don't coutn the use utf8; as automatic/implicit.

Re^5: Default encoding rules leave me puzzled... (use open qw/ :std :locale /;
by ikegami (Patriarch) on Jun 23, 2014 at 03:28 UTC

    I mean, else, why would a string internally stored as UTF-8 be converted to Latin-1 when sent to the standard output ?

    Because you are printing the string, not its internal representation. The layout of a scalar is irrelevant.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2024-04-19 21:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found