Strings are treated as iso-latin-1 by default. Decode them if they're not.
my $s = "\xC2\x85"; print(length($s), "\n"); # 2 iso-latin-1 chars utf8::decode($s); print(length($s), "\n"); # 1 character
Way of decoding:
In reply to Re: function length() in UTF-8 context
by ikegami
in thread function length() in UTF-8 context
by didess
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |