3 ms·
I wrote about this eons ago: https://cryptonector.com/2006/12/filesystem-i18n/ https://cryptonector.com/2006/12/filesystem-i18n/ and https://cryptonector.com/20
by cryptonector 9y ago
I wrote about this eons ago: https://cryptonector.com/2006/12/filesystem-i18n/ https://cryptonector.com/2006/12/filesystem-i18n/ and https://cryptonector.com/2010/04/on-unicode-normalization-or-why-normalization-insensitivity-should-be-rule/ https://cryptonector.com/2010/04/on-unicode-normalization-or... -- these might still be available on https://blogs.oracle.com/ https://blogs.oracle.com/, though these are from my days at Sun.
TL;DR, basically, the lack of ability to tag strings in the system call API with codesets means that UTF-8 is the only plausible answer, and the ends (C library system call stubs, filesystems) have to apply whatever codeset conversions. But there's practically zero chance of C library system call stubs (and related functions) performing codeset conversions (can you imagine readdir(3) doing it?), which means that the only reasonable answer is to use UTF-8 locales and be done.
Even shorter: just use UTF-8 locales and be done.
- netheril96 9y agoYou cannot use UTF-8 locales on Windows though.
- cryptonector 9y agoThat's OK. On Unix use UTF-8. On Windows use Unicode, and let apps use UTF-8 or UTF-16 as appropriate -- the kernel/NTFS make it right.
- beagle3 9y agochcp 65001 and bob's your uncle.
- JdeBP 9y agoThat's alright. On Windows, cryptonector's assertion about a lack of tagging API calls with code sets is wrong to begin with and the reasoning thus does not apply. All of the ...A() API calls are implicitly tagged with the current code page, after all.