use charnames qw( :full ); use feature qw( say ); use Encode qw( encode_utf8 ); my $text = "\N{LATIN SMALL LETTER E WITH ACUTE}"; say length $text; # 1 my $utf8 = encode_utf8($text); say length $utf8; # 2
In reply to Re: Best Way to Get Length of UTF-8 String in Bytes?
by ikegami
in thread Best Way to Get Length of UTF-8 String in Bytes?
by Jim
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |