Better HN
topnewbestaskshowjobs
Log inSign up

bananapeel

3 karma · joined Apr 12, 2018 (8y ago) · 1 submissions

Submissions

comment 8y ago · link · parent

Actually, the UTF-8 decoding is broken even with proper input. This https://github.com/btwael/SuperString/blob/master/src/SuperS... will make `pointer` and `i` be out of sync, so everything after the first multibyte sequence is a coin toss.

To the OP: you should use theses tests to validate your implementation https://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt (caveat: 5- and 6-byte sequences are no longer valid UTF-8 and should be rejected).