Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: why no default unicode?

by repellent (Priest)
on Mar 20, 2011 at 07:21 UTC ( [id://894287]=note: print w/replies, xml ) Need Help??


in reply to why no default unicode?

Here's the big secret about encodings: You need a priori knowledge of which encoding to use for each specific data stream.

That means, you cannot effectively auto-detect which encoding to use simply by observing the data stream alone. An out-of-band message may be used to signal which encoding to use, as is typical with web browsers using the HTTP protocol.

You pointed out your locale settings and suggested that Perl makes use of them. Having Perl set encodings for STDIN/STDOUT/STDERR based on locale would break any data stream that is not encoded as such. Not to mention, applying encoding to many data streams based on global (locale) settings violates what I mentioned earlier.

By default, Perl assumes every stream has no encoding (1 character per byte) - it's safe (i.e. binary data won't break) and is a reasonable default (i.e. an otherwise implicit encoding based on locale is hard to see).

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (None)
    As of 2024-04-25 01:07 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found