Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
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 drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2014-10-23 15:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (125 votes), past polls