4 ms·
Actually sorting should be fine. The order of UTF-8 will always be the same as the codepoints encoded under it if you sort it as binary. I really appreciate th
by treffer 8y ago
Actually sorting should be fine. The order of UTF-8 will always be the same as the codepoints encoded under it if you sort it as binary.
I really appreciate this property of UTF-8, and I can highly recommend to do a pen&paper exercise to see why it preserves order :-)
It wouldn't work if you want any type of normalisation and especially solving composition/decomposition.
- burntsushi 8y agoLocale specific sorting is not the same as sorting by codepoint. The Unicode collation algorithm is fairly involved: https://www.unicode.org/reports/tr10/ https://www.unicode.org/reports/tr10/