Help for this page
#copy so we don't muck utf8 flag on original string my $sTmp=$someData; Encode::_utf8_off($sTmp); my $iLength = length($sTmp);
sub countBytes { my $s=$_[0]; #makes copy ... printf "chr=<%s> utf8-flag=%s length=%d bytes=%s\n" , $s, Encode::is_utf8($s)?'yes':'no', length($s), $iBytes; #outputs: chr=<?> utf8-flag=yes length=1 bytes=2