http://qs321.pair.com?node_id=1230691


in reply to Re^2: truncate string to byte count
in thread truncate string to byte count

Tests 1 to 11 are incorrect because they don't provide UTF-8. Replace

is truncate_utf8($in, ...), "...";
with
is truncate_utf8(encode_utf8($in), ...), encode_utf8("...");