Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re^12: any use of 'use locale'? (source encoding)

by wanradt (Scribe)
on Nov 30, 2009 at 19:56 UTC ( #810262=note: print w/replies, xml ) Need Help??

in reply to Re^11: any use of 'use locale'? (source encoding)
in thread any use of 'use locale'?

I have more thinking to do with your answer, but main (for me) questions i can review.

Pretending it would currently be possible to implement "use utf8_everywhere", it would break every single piece of code that assumes characters are bytes.

Do you mean, that would break any code, which i incorporate to my project if i declare "use utf8_everywhere"? Then, why it does not break now when i use same things (like "use utf8", "use open", binmode...) separately?

Or do you mean, it will break "characters are bytes"-code, if they use "use uf8_everywhere"? Then i agree, but why they need such declaration?

Assume you read four bytes 0x42 0xC3 0x84 0x48, e.g. from STDIN, a file you opened, an inherited file handle, a command line argument or an environment variable. How many characters do these bytes represent? Explain why

If i am declared fully utf8 environment, i treat them being 3 utf8 characters. If i need some other behaviour, i ask it explicitly to handle the source which from those bytes are coming. Where is the problem?

Nġnda, WK
  • Comment on Re^12: any use of 'use locale'? (source encoding)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://810262]
[ambrus]: The file I'm reading is already filtered, which is why I found only one kind of entry.
[1nickt]: Sorry to upset you brother Ambrus ...
[1nickt]: Ah not me, good!

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2018-01-23 13:10 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (246 votes). Check out past polls.