Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

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

by ikegami (Pope)
on Feb 07, 2014 at 21:06 UTC ( #1073917=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use utf8;                    # Source code is encoded using UTF-8.
    use open ':std', ':locale';  # Decode inputs and encode inputs.
    ...
       my @utf8 = unpack('C*', $utf8);
       push @chars, [ $char, $cp, $utf8, @utf8 ];
    }
    
  2. or download this
    my $last = 0;
    for (@chars) {
    ...
    for my $i (3..$last) {
       say join '  ', map { defined($_->[$i]) ? sprintf '%08b', $_->[$i] :
    + (' 'x8) } @chars;
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2015-07-05 10:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (61 votes), past polls