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

How to sanely handle unicode in perl?

by Sec (Monk)
on Mar 20, 2015 at 16:18 UTC ( #1120759=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    
    ...
    print "That line is: ",$line,"\n";
    $line =~ s//o/;
    print "That line in ascii is: $line\n";
    
  2. or download this
    karoshi:~>LC_CTYPE=de_DE.UTF-8 ./u8demo.pl
    I read a line, that is 1 chars long.
    ...
    I read a line, that is 8 chars long.
    That line is: \xC3\xB6
    That line in ascii is: \xC3\xB6
    
  3. or download this
    karoshi:~>./u8demo.pl
    I read a line, that is 1 chars long.
    That line is: �
    That line in ascii is: o
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2022-01-25 06:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (65 votes). Check out past polls.

    Notices?