A transport chunk may end inside a UTF-8 sequence; the decoder must retain the incomplete bytes until the next chunk.

UTF-8 preserves text only when byte boundaries and decoding rules agree

UTF-8 encodes Unicode scalar values using one to four bytes. ASCII characters retain their familiar one-byte representation, while many other characters need longer sequences. This makes UTF-8 a useful interchange format, but it does not make arbitrary bytes valid text or every byte offset a character boundary. Correct handling requires an agreed encoding, strict validity rules where appropriate, and a clear distinction between bytes and decoded text. ...

December 2, 2026 · 5 min · XB Field Notes