3 ms·
> UTF-8 sorts lexicographically using the same naïve byte comparison which works for ASCII This isn’t necessarily true beyond ASCII, and it depends entirely on
by sgarland 2y ago
> UTF-8 sorts lexicographically using the same naïve byte comparison which works for ASCII
This isn’t necessarily true beyond ASCII, and it depends entirely on the collation [0]. One need only to spend some time peering into the abyss that is RDBMS collation support [1] [2] to see the horror.
[0]: http://www.unicode.org/reports/tr10/ http://www.unicode.org/reports/tr10/
[1]: https://dev.mysql.com/doc/refman/8.4/en/charset-unicode-sets.html https://dev.mysql.com/doc/refman/8.4/en/charset-unicode-sets...
[2]: https://www.postgresql.org/docs/current/collation.html https://www.postgresql.org/docs/current/collation.html
- samatman 2y agoWell, no. It sorts according to the lexiographical order of Unicode. Earlier points before later points. How useful this is depends on the language, of course. I did say that as well. But Unicode was put together from legacy character encodings, and did what it could to preserve the order of those, so it's far from useless.