I just read an article about how MacOS updates now need to be 3 GB and an hour just to update a few kilobytes for... reasons. (Obviously not good ones IMO.)
It would definitely be nice if we could gain new emojis without having to go through all of that. Then again, is waiting a few months for newly defined emojis such a big deal? Although you can't type them, emojis otherwise behalve like all other text, so it seems suboptimal to have different systems for text and emoji. Also, even if an OS maker
could update emojis without doing a software update, would they? Someone still needs to draw those pictures on a certain deadline.
About unicode support: around 1990, the OS makers were onboard with unicode. Although I only really speak Dutch and English, I do have some exposure to German, French and Spanish. All those languages work just fine with ISO-8859-1. But what if you translate between Greek and Russian? There was no reasonable way to do that during the 8-bit extended ASCII era. And of course for people to be able to do that, the OSes needed to support it.
I think the idea was to just switch from 8-bit characters to 16-bit ones and call it a day. From what I've read, that's what for instance Windows, Java and Javascript did. I also gather that Apple's HFS+ file system uses 16-bit characters for its names.
However, it turned out we need more than 16 bits and even if you don't use the extra stuff, there's still lots of complexities such as (virtually?) unlimited combining and modifier characters. So unicode has a lot more complexity than just more bits per character.
Fortunately, UTF-8 came along and saved the day so people who wanted to keep their character width 8 bits could live to fight another day. Unfortunately, because of the > 16 bit, UTF-16 replaced UCS-2, so you rewrote all your stuff to handle 16-bit characters but now there's actually characters that are encoded as 2 16-bit values, never mind all the combining stuff.
So unicode breaks a bunch of assumptions:
- A code point is 8 bits
- A code point is 16 bits
- There is a bit you can flip to change case
- A glyph is one code point
- Given a monospace font, each code point occupies the same screen space
- You can split a string at any code point boundary
- String compare for two strings that produce the same glyphs == true
As a programmer, you deal with the first six issues by either by simply not attempting to change case or split strings or by using unicode-aware APIs.
The last one is a big one: even if you otherwise avoid the complexity of unicode by just treating text as an opaque sequence of bytes, if you want to be able to do string compares or searches, you need to normalize your strings properly. And there's multiple normalizations appropriate for different operations, so learn them, love them, use them.
For instance, unicode imported (among other things) all the ISO 8859 encodings, which use an 8-bit code point for characters like é. However, you can also make that same glyph with e + combining acute accent. Those are different UTF-8, UTF-16 or UTF-32 sequences. But they are canonically equivalent. So either use NFC, the composed form, or NFD, the decomposed form with a separate combining diacritic. (Just for fun, there's characters that don't decompose as well as many that don't compose. Doesn't matter for normalization, though.)
So for comparing, normalize both strings to either NFC or NFD. Doesn't matter which one. (For transmission/storage, NFC encoding is preferred for the web as it's more compatible with some old stuff. Then again, with NFD, if the accents aren't recognized, you still see the base characters.)
But for searching, you'll want to use the "compatiblity (de)composition" NFKC or NFKD. Here, things that definitely don't
look the same, such as "CO₂" == "CO2" will match because they (presumably!)
mean the same. However, this doesn't work for "café" == "cafe". So for that, you'd have to further process a string.