marekrei / encode-explorer

http://encode-explorer.siineiolekala.net
236 stars 120 forks source link

Language specific name sorting #80

Open isness opened 4 years ago

isness commented 4 years ago

Currently, the problem is that file and directory names are not sorted correctly. If charset is set to UTF-8, strcasecmp fails to sort them in the correct order. I modified cmp_name function to address this problem: firstly, it creates a collator using the language set in $_CONFIG, then uses it in collator_compare to compare two strings.

I guess there should be different cases for different charsets, at least for unicode and non-unicode, so any help is appreciated.