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

Re: How to print the actual bytes of UTF-8 characters ?

by pajout (Curate)
on Feb 07, 2014 at 13:09 UTC ( [id://1073875]=note: print w/replies, xml ) Need Help??


in reply to How to print the actual bytes of UTF-8 characters ?

I think you need something like this:
#!/usr/bin/perl use utf8; my $str = 'Ð Ñ Ò Ó'; print $str."\n"; foreach my $ch (split('', $str)) { print ord($ch)."\n"; } use bytes; print "bytes\n"; foreach my $ch (split('', $str)) { printf("%x %b\n", ord($ch), ord($ch)); }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-04-18 14:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found