Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

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

by Jim (Curate)
on Sep 26, 2011 at 01:29 UTC ( #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.


Comment on Re^2: Trying to determine the output length of a Unicode string
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (9)
As of 2014-12-18 23:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (69 votes), past polls