Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Fast UTF-8 validation. Parent comment
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.
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.