Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

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

by Jim (Curate)
on Sep 26, 2011 at 01:29 UTC ( [id://927780]=note: print w/replies, xml ) Need Help??


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

unicode_strings only ensures that Perl uses character semantics instead of byte semantics for all string operations, which is helpful in the face of ambiguity. (See The "Unicode Bug" in perlunicode.) It doesn't alter the behavior of the length function, which measures the length of a Unicode string in code points, not in grapheme clusters (that is, in real characters).

There's no built-in function in Perl to measure the length of a Unicode string in grapheme clusters rather than in code points.

Read chromatic's article titled New Features of Perl 5.14: unicode_strings for a helpful overview of unicode_strings.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-04-25 07:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found