3 ms·
Just to make sure I understand, this assumes that you start decoding at the beginning of a byte, not halfway through a byte, correct?
by gautamcgoel 5y ago
Just to make sure I understand, this assumes that you start decoding at the beginning of a byte, not halfway through a byte, correct?
- not2b 5y agoYes, the structure could still help resync if you have a bitstream and not a bytestream (you could identify the MSBs of bytes from their very different statistical behavior), but it isn't as trivial as skipping continuation bytes, those with '10' in the most significant position. You'd need to track all 8 shift positions until you find the one that looks like UTF-8.