3 ms·
The original pattern extends up to at least 36 bits (which makes the PDP-10 refugees happy). 1 7 0xxxxxxx 2 11 110xxxxx 10xxxxxx 3 16 1110xxxx
by kps 7y ago
The original pattern extends up to at least 36 bits (which makes the PDP-10 refugees happy).
1 7 0xxxxxxx
2 11 110xxxxx 10xxxxxx
3 16 1110xxxx 10xxxxxx 10xxxxxx
4 21 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
5 26 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
6 31 1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
7 36 11111110 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
Then, you can either decide to limit the leader to one byte, giving you 42 bits…
8 42 11111111 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
Or allow multi-byte leaders and continue forever.
9 53 11111111 110xxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
10 58 11111111 1110xxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
⋮
The Intergalactic Confederation will not look kindly on UTF-16.
- cesarb 7y ago> Or allow multi-byte leaders and continue forever. That loses one very useful property of UTF-8: you always know, by looking at a single byte, whether it's the first byte of a code point or not. It also loses the property that no valid UTF-8 encoding is a subset of another valid UTF-8 encoding. It's better to stop at 36 bits (which keeps another useful property: you'll never find a 0xFF byte within an UTF-8 string, and you'll only find a 0x00 byte when it's encoding the U+0000 code point).
- cat199 7y ago> The original pattern extends up to at least 36 bits (which makes the PDP-10 refugees happy). Naah.. there's UTF-9 and UTF-18 for that.. https://tools.ietf.org/html/rfc4042 https://tools.ietf.org/html/rfc4042