Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
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 scrutinizing the Monastery: (5)
As of 2014-08-23 06:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (172 votes), past polls