5 ms·
And where do you sort the letter ä? (After a is correct in German, but I think Swedish does it differently.)
by _9ptr 1y ago
And where do you sort the letter ä? (After a is correct in German, but I think Swedish does it differently.)
- dvdkon 1y agoThis feels like the right moment to mention "ch", which is considered a letter in orthodox Czech, sorted between "h" and "i". The problem is, you can't reliably distinguish between "ch"-the-letter and "ch" as just "c" and "h" combined, which are present in loan words but also some original Czech compound words. So if you're doing it "properly", sorting strings in Czech involves understanding the etymology of every word.
- bmn__ 1y agoWhat a headache! I'm glad that the relevant standard ČSN 97 6030 does not demand analysis of compounds or knowledge of etymology.
- jcynix 1y agoThat's why we have all this LC_* stuff in Linux, which you can configure to your needs: export LC_MEASUREMENT="de_DE" export LC_MONETARY="de_DE" export LC_PAPER="de_DE" export LC_CTYPE=de_DE.UTF-8 export LC_MESSAGES="en_US.UTF-8" export LC_RESPONSE="en_US.UTF-8" export LC_TIME=en_US.UTF-8 Mix in your Swedish or Swaheli, maybe even the Vatican State: e.g. de_DE, sw_TZ, it_VA (not guaranteed ;-).
- chongli 1y agoHow does this work if you're a multi-lingual person and you have files with names in different languages?
- chithanh 1y agoThe sorting order is only defined between strings of the same locale, not between strings of different locales. You can specify the sorting order per command like LC_COLLATE="tr_TR.utf8" ls if it differs from your system or user locale. An alternative is to first transliterate the strings to ASCII and then sort them (but this does not preserve the sorting order of non-latin scripts).
- jcynix 1y agoI'm multi-lingual but try to separate business stuff for example (multi-lingual) from private stuff (mostly one language), so clashes between languages rarely happen. But if it gets complicated I'll usually resort to Perl scripts to take care of pesky details. Sorting an associative array where the key is a string in unified form and the value is the multi-lingual target is rather easy in a script language which one is fluent in.
- 1718627440 1y agoYou could alias cd to a shell script that sets the env based on the location.
- ongy 1y ago> export LC_TIME=en_US.UTF-8 Why would you do this to yourself?