Tests 1 to 11 are incorrect because they don't provide UTF-8. Replace
withis truncate_utf8($in, ...), "...";
is truncate_utf8(encode_utf8($in), ...), encode_utf8("...");
In reply to Re^3: truncate string to byte count
by ikegami
in thread truncate string to byte count
by morgon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |