by chubot · 2y ago · 0 comments
The main impediment seems to be that languages like Java, JavaScript, and Python treat UTF-8 as just another encoding, but really it’s the most fundamental encoding.
The language abstractions get in the way and distort the way people think about text
Newer languages like Go and Rust are more sensible, they don’t have global mutable encoding variables
https://en.wikipedia.org/wiki/UTF-16#U+D800_to_U+DFFF_(surro...
UTF-8 is the most ubiquitous encoding on the web, but that doesn't make it more fundamental than any other.
Either that, or I'm completely off base and part of the vast horde who don't get it.
And while UTF-8 tries very hard to be simple whenever possible, it does have some nonobvious constraints that make it significantly more complex than the actual simplest variable-width encoding (a continuation bit and then 7 data bits).
Except when it's 1, because that's an invalid start, and except when it's 0, because that means the character is a single byte.
And it also means you're dealing with three classes of byte now.
Plus UTF-8 has more invalid encodings to deal with than a super-simple format.