Break any string into its underlying UTF-8 bytes — or any raw byte stream into code points — and see the full anatomy of each sequence: lead byte vs continuation bytes, code point boundaries, plane and block, and every failure mode the spec catches: overlong, unpaired surrogate, out-of-range, truncated, and stray continuation. Handy for diagnosing mojibake, hunting BOMs, and understanding why one emoji is four bytes.
A well-formed UTF-8 code point is 1–4 bytes long. The number of leading 1-bits in the lead byte tells you the total length: 0xxxxxxx=1 byte, 110xxxxx=2 bytes, 1110xxxx=3 bytes, 11110xxx=4 bytes. Every following byte is a continuation matching 10xxxxxx. Bytes 0xC0, 0xC1, 0xF5–0xFF can never legally appear.
C0 80 for U+0000). Rejected by RFC 3629 to prevent smuggling attacks.10xxxxxx byte appearing without a lead byte.