Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: Simplest Possible Way To Disable Unicode

by ikegami (Pope)
on May 24, 2011 at 00:42 UTC ( #906393=note: print w/replies, xml ) Need Help??


in reply to Re: Simplest Possible Way To Disable Unicode
in thread Simplest Possible Way To Disable Unicode

when the internal data is already known to be the same as how it should be written (UTF-8).

syswrite and print print the string, not its internal data. The internal storage format is not relevant here.

>perl -we"$_ = chr(0xE9); utf8::downgrade($_); print;" | perl -nE"say +length;" 1 >perl -we"$_ = chr(0xE9); utf8::upgrade($_); print;" | perl -nE"say le +ngth;" 1 >perl -we"$_ = chr(1000); utf8::upgrade($_); print;" | perl -nE"say le +ngth;" Wide character in print at -e line 1. 2

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2021-03-07 18:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favorite kind of desktop background is:











    Results (122 votes). Check out past polls.

    Notices?