|
|
| go ahead... be a heretic | |
| PerlMonks |
Re: The “real length" of UTF8 stringsby betterworld (Curate) |
| on Sep 23, 2008 at 20:21 UTC ( [id://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
|
|
||||||||||||||||||||||||||||||||||||||||||