in reply to Re: Re: Re: s/.// increases length - bug or badly documented feature
in thread s/.// increases length - bug or badly documented feature
There is currently no easy way to mark data read from a file or other external source as being utf8.
Alternatives for these subs are welcome, of course.sub byte_length { # depends on bugs no utf8; my ($string) = @_; my $counter; $counter++ while $string =~ s/.//s; return $counter; } sub has_multibytes { my ($string) = @_; return length($string) != byte_length($string); }
|
---|