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

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

I think you're making assumptions about what the OP's input data looks like...

Update:

Tests 1 to 11 ... Replace ...

It is uncool to update a node in a way that renders replies confusing or meaningless.

Update 2: How about "is is uncool to make someone chase down all of your ninja edits and wonder when the ninja editing will be done." You made several other ninja edits (like this one) to your nodes and I had to update my replies several times while composing them.

Replies are listed 'Best First'.
Re^5: truncate string to byte count
by ikegami (Patriarch) on Feb 28, 2019 at 21:19 UTC

    No. "say I have an utf-8 encoded string"

Re^5: truncate string to byte count
by ikegami (Patriarch) on Feb 28, 2019 at 21:25 UTC

    1. There was no reply. 2. Neither noticing that test 12 is an empty string nor adding a bug fix to the bug explanation render the future reply confusing or meaningless.