3 ms·
Reading https://en.wikipedia.org/wiki/UTF-8#Encoding https://en.wikipedia.org/wiki/UTF-8#Encoding, when we get to 8-byte long UTF-8 code points, the first byte
by Someone 4y ago
Reading https://en.wikipedia.org/wiki/UTF-8#Encoding https://en.wikipedia.org/wiki/UTF-8#Encoding, when we get to 8-byte long UTF-8 code points, the first byte would have to be all ones (11111111)
Those would have room for 7 bytes with 6 bits of data each, or 42 bits.
Of course, if the need arises (which won’t be soon) we could choose to add another byte to encode the length of the actual byte stream.
(Currently, even going beyond four bytes already would break code, as Unicode explicitly limited the UTF-8 encoding in https://datatracker.ietf.org/doc/html/rfc3629 https://datatracker.ietf.org/doc/html/rfc3629 to allow round-tripping to UTF-16. I also think the above goes beyond what was proposed historically (https://en.wikipedia.org/wiki/UTF-8#History https://en.wikipedia.org/wiki/UTF-8#History))