There's a problem with sorting files with accents in the filename.
In this example, I'm using the letters č š ž, from Slavic languages using Latin script.
When I go to "Sort active panel" and mark "By Name" -> "Ascending"
files are sorted alphabetically considering accents, like this:
Image: https://postimg.cc/CRX5Nc3F
When I go to "Sort active panel" and mark "By Extension" -> "Ascending"
files are sorted by numeric character code, like this:
Image: https://postimg.cc/SX9stW4c
There's no "Sort method" option in "Configuration", like there is in Total Commander for PC.
Sorting files with accents in filename
Moderators: Hacker, petermad, Stefan2, white
Re: Sorting files with accents in filename
2gmb
So it is the secondary sorting by name when choosing sort By Extension that is wrong . what about files with the same name but with the different Slavic characters in the extension - are they sorted correctly (file.c, file.č, file.s, file.š, file.z and file.ž)
So it is the secondary sorting by name when choosing sort By Extension that is wrong . what about files with the same name but with the different Slavic characters in the extension - are they sorted correctly (file.c, file.č, file.s, file.š, file.z and file.ž)
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
- ghisler(Author)
- Site Admin
- Posts: 50386
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Sorting files with accents in filename
Total Commander uses Collections.sort() to sort the file list. This calls "compare" for each pair of file names, which are then compared with a class called Collator. The collator performs locale-specific comparisons.
Total Commander loads the collator as follows:
So the rules by which the lists are sorted depend on the current default system locale (language settings) of your Android device. If your device is set to English (UK) locale, it will use English rules.
Please check your Android settings what locale is set there.
Total Commander loads the collator as follows:
According to the debugger, this uses the RuleBasedCollator class.collator=java.text.Collator.getInstance(Locale.getDefault());
So the rules by which the lists are sorted depend on the current default system locale (language settings) of your Android device. If your device is set to English (UK) locale, it will use English rules.
Please check your Android settings what locale is set there.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: Sorting files with accents in filename
I'm using Total Commander 3.50b3
Xiaomi Redmi 8, MIUI 12.5.2, Android 10
System default language is Croatian, and language in Total Commander is set to Croatian.
If language in Total Commander is set to Czech, results are the same.
When sorting by name, files are sorted in correct alphabetical order ( c č s š z ž ), both by names and by extensions.
When sorting by extensions, files are sorted in correct alphabetical order by extensions ( c č s š z ž ), bur the names are sorted by character code ( c s z č š ž ).
When sorting by size or by time, both names and extensions are sorted by character code ( c s z č š ž ).
All files in the example are the same, with the same content, size and time.
If I change language in Total Commander to English, sorting by extensions, size or time is the same as above.
Sorting by name then uses some strange (and wrong) logic.
Xiaomi Redmi 8, MIUI 12.5.2, Android 10
System default language is Croatian, and language in Total Commander is set to Croatian.
If language in Total Commander is set to Czech, results are the same.
When sorting by name, files are sorted in correct alphabetical order ( c č s š z ž ), both by names and by extensions.
When sorting by extensions, files are sorted in correct alphabetical order by extensions ( c č s š z ž ), bur the names are sorted by character code ( c s z č š ž ).
When sorting by size or by time, both names and extensions are sorted by character code ( c s z č š ž ).
All files in the example are the same, with the same content, size and time.
If I change language in Total Commander to English, sorting by extensions, size or time is the same as above.
Sorting by name then uses some strange (and wrong) logic.
Re: Sorting files with accents in filename
AS I suspected - it is the secondary sorting (after sorting by extension, size or date) that is wrongbur the names are sorted by character code ( c s z č š ž ).
When sorting by size or by time, both names and extensions are sorted by character code ( c s z č š ž ).
All files in the example are the same, with the same content, size and time.
If I change language in Total Commander to English, sorting by extensions, size or time is the same as above.
Sorting by name then uses some strange (and wrong) logic.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
- ghisler(Author)
- Site Admin
- Posts: 50386
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Sorting files with accents in filename
You are right, the compare function is comparing the name objects (which would be the text strings) when the result is "equal", e.g. when the extensions are the same. I will compare by name when they are the same.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com