The 0xff byte cannot appear in a valid UTF-8 sequence, and there cannot be any of 0xfc, 0xfd, 0xfe.
All UTF-8 bytes must match one of
0xxxxxxx - Lower 7 bit. 10xxxxxx - Second and subsequent bytes in a multi-byte sequence. 110xxxxx - First byte of a two-byte sequence. 1110xxxx - First byte of a three-byte sequence. 11110xxx - First byte of a four-byte sequence. 111110xx - First byte of a five-byte sequence. 1111110x - First byte of a six-byte sequence.
No seven or more byte sequences. the latest version of UTF-8 allows only UTF-8 sequences up to 4 bytes long, which would leave 0xf8-0xff unused, but it is possible although the byte sequence can rightly be called UTF-8 according to the outdated version and include octets in 0xf8-0xfb.
source share