|
|
|
Your skill will accomplish what the force of many cannot |
|
| PerlMonks |
Re: The “real length" of UTF8 stringsby betterworld (Deacon) |
| on Sep 23, 2008 at 20:21 UTC ( #713298=note: print w/ replies, xml ) | Need Help?? |
|
length returns the number of characters. To get the length in bytes, you have to convert the string into a given encoding:
Since Unicode strings are stored in utf8 internally, you can use a number of hacks to avoid the explicit re-encoding:
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||