top | item 45103757

(no title)

jeberle | 6 months ago

You forgot `- 2^11` for the surrogate pairs. Gee, why isn't Unicode 2^21 code points? To understand the Unicode code point space you must understand UTF-16. The code space is defined by how UTF-16 works. That was my initial point.

discuss

order

jcranmer|6 months ago

If you're going to count the surrogate pairs as not-a-Unicode-codepoint, you should also count the other noncharacters: the last two codepoints on each of the 17 planes and the range U+FDD0-U+FDEF.

The expansion of Unicode beyond the BMP was designed to facilitate an upgrade compatibility path from UCS-2 systems, but it is extremely incorrect to somehow equate Unicode with UTF-16.

kbolino|6 months ago

FWIW there is an official term for "code points excluding surrogates", it is "Unicode scalar value".

jeberle|6 months ago

OK, I'm lost here. Why is there a 1:1 correspondence between the two?