4 ms·
> You have to go all the way to UTF-32 to get back to a fixed width encoding. UTF-21, actually, as there are no code points above 0x10FFFF. Powers of two have
by evincarofautumn 13y ago
> You have to go all the way to UTF-32 to get back to a fixed width encoding.
UTF-21, actually, as there are no code points above 0x10FFFF. Powers of two have other nice properties, though.
- ygra 13y agoThere is no UTF-21. The number after UTF signifies the size of the code unit, which in UTF-32 is 32 bits wide. That code points are only defined up to U+10FFFF is irrelevant for that; the code unit is still 32 bits.
- evincarofautumn 13y agoYeah, I was joking. UTF-32 is a waste of 11 perfectly good bits[1], so you could just as well write each code point as 21 bits (0o0000000–0o7777777), and call it UTF-21. 24 bits (3 × 0x00–0x7F) would be fine too, but 21 is the smallest possible fixed-width Unicode encoding. [1]: https://github.com/evincarofautumn/protodata https://github.com/evincarofautumn/protodata