2 ms·
"Correct" isn't quite, well, correct here ;) For a starting point, case-insensitive comparison is comparison, and is locale-specific. The general name for the
by samatman 2y ago
"Correct" isn't quite, well, correct here ;)
For a starting point, case-insensitive comparison is comparison, and is locale-specific.
The general name for the task we're discussion is "collation". Unicode defines a standard collation algorithm: https://www.unicode.org/reports/tr10/ https://www.unicode.org/reports/tr10/
This is designed (because it has to be) to work with locale data, also provided by Unicode https://cldr.unicode.org https://cldr.unicode.org
I would say that the minimum a language's standard library should provide is: all the normalization forms, and a lexicographical sort. "Fancy Unicode" (there's a lot!) is better off as a library of its own, or perhaps several: covering every single base is a monumental achievement, and a rather large codebase.
There are valid sorts not defined by Unicode, involving abbreviations, standard corrections of misspellings, and much more: these are needed for tasks like address normalization.