News for hackers. Stuff that matters.
Re:Fast UTF-8 validation by Dylan16807 on Wednesday October 21, 2020 @03:57AM (#24845687)
I strongly question "doesn't require a validation pass".

1. Your code drops naked continuation bytes entirely.

2. If a valid multibyte character is followed by extraneous continuation bytes it will not decode correctly.

3. Using the wrong number of continuation bytes is a giant mess and can give you arbitrary numbers in multiple ways.

The second one especially is a behavior that's hard to defend.

There are no comments on this comment yet.