Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Trying to determine the output length of a Unicode string

by ikegami (Patriarch)
on Sep 25, 2011 at 22:38 UTC ( [id://927775]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    perl -e'
       binmode(STDOUT, ":encoding(UTF-8)";
    ...
       say length($text);
       say $text;
    '
    
  2. or download this
    perl -MEncode -e'
       $text="\x{00fc}";
    ...
       say encode("UTF-8", length($bytes));
       say $bytes;
    '
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-03-19 03:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found