Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: incremental reading of utf8 input handles

by moritz (Cardinal)
on Jul 06, 2012 at 18:09 UTC ( #980344=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $ perl -MEncode=encode_utf8 -wE '$| = 1; my $buf = encode_utf8 chr(0xe
    +5); print substr($buf, 0, 1); sleep 1; say substr($buf, 1)' | perl -C
    +S -pe 1
    
    
  2. or download this
    $buf =~ s/^((?:[\x00-\x7f]+|[\xc0-0xff][\x80-\xbf]+)*)//;
    my $newtext = $1;
    utf8::decode($newtext);
    $text_so_far .= $newtext;
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (9)
As of 2014-11-28 19:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (200 votes), past polls