4 ms·
It's also worth noting where the terms "UCS-2" and "UCS-4" come from. For a while there was the idea of the Universal Coded Character Set[0] as an alternative
by Sniffnoy 7y ago
It's also worth noting where the terms "UCS-2" and "UCS-4" come from. For a while there was the idea of the Universal Coded Character Set[0] as an alternative to Unicode. This would have been a natively 32-bit encoding. However, it wouldn't have allowed the full 2^32 possible characters, because of its insistence that none of the 4 bytes could be any of the C0 or C1 controls. Still, it would have about 2^29 possible characters as opposed to Unicode's about 2^21.
But the insistence on avoiding C0 and C1 controls would have led to some odd codepoint numbers, and definite incompatibility with ASCII and Unicode; for instance, 'A', instead of 0x41, would have been 0x20202041! Whereas Unicode of course made sure to copy ASCII (indeed, to copy ISO-8859-1) for its first block.
Of course, this didn't come to pass because, well, people were already supporting 16-bit Unicode and didn't want to switch again. And I'm kind of glad it didn't -- while it would have meant not having to deal with the compromise that is UTF-16, imagine living in a world where 'A' is not 0x41, but rather 0x20202041! (Or imagine opening up a text file and finding three spaces between each character...)
[0]https://en.wikipedia.org/wiki/Universal_Coded_Character_Set https://en.wikipedia.org/wiki/Universal_Coded_Character_Set
- unascribed 7y agoI would've mentioned this in my post but didn't feel I could do the topic justice as I'm not submersed in it like I am the UTF-16 tragedy. This is indeed an important aside, though.
- tyingq 7y ago"imagine living in a world where 'A' is not 0x41, but rather 0x20202041! (Or imagine opening up a text file and finding three spaces between each character...)" On the other hand, often "obviously broken" is better than "subtly broken". There's a ton of undetected encoding problems in the wild right now.