5 ms·
It doesn't mention the biggest disadvantages of UTF-8 relatives to UTF-16: the existence of non-shortest forms and invalid code units.
by millstone 10y ago
It doesn't mention the biggest disadvantages of UTF-8 relatives to UTF-16: the existence of non-shortest forms and invalid code units.
- syncsynchalt 10y agoAh, but those are disallowed by spec and in the former case you'd open a security bug against anything that didn't transform it to U+FFFD or similar (eg. it lets you sneak '\0's into C-style strings and '/'s into unix paths). So I'll grant you a point but could match that against similar problems in UTF-16 (bad surrogate pairs, surrogate singletons, BOM bombs, and the same invalid code units).