FS#6359 - Correctly (Latin1) sorted filenames in tree browser

Attached to Project: Rockbox
Opened by Tobias Heimann (Killaruna) - Monday, 20 November 2006, 00:46 GMT
Last edited by Jonathan Gordon (jdgordon) - Thursday, 14 October 2010, 12:21 GMT
Task Type Patches
Category User Interface
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


This is a tiny patch to correct the file ordering for the Latin-1 charset when browsing the file tree: Characters with accents and the german Umlaute are sorted to the same positions as their normal (i.e. unaccented) versions instead of to the end of the list. The new sort order overrides the old non-case-sensitive sorting. Case-sensitive sorting is still using the old method.
This task depends upon

Closed by  Jonathan Gordon (jdgordon)
Thursday, 14 October 2010, 12:21 GMT
Reason for closing:  Rejected
Additional comments about closing:  there is no perfect solution for this, and trying to make one for a small subset of the supported charsets is no better than using ascii value sorting
Comment by Jonas Häggqvist (rasher) - Monday, 20 November 2006, 00:52 GMT
How does it sort æøå/ÆØÅ? In Danish at least, they traditionally come at the end of the alphabet, after z/Z. I don't know about other languages which use these characters (Primarily Swedish and Norwegian).
Comment by Tobias Heimann (Killaruna) - Monday, 20 November 2006, 01:28 GMT
Like aoa - I've put all special characters to the same position as the closest normal character, assuming that these are the correct places... But basically you can sort the characters as you like, the function works with a priority table (just as the original strncasecmp).
Comment by Jonas Häggqvist (rasher) - Monday, 20 November 2006, 01:34 GMT
I believe those should be moved to be directly after z, as this is the case in all languages which use them ( and Æ, ø and å are not considered as "variations" of a o and a, but as characters, so sorting them next to a and o would be really strange. Luckily, this goes for all languages using æøå - the sorting of ö and ä is, as you can see in the Swedish alphabet (where they are considered separate characters) not so clear-cut.
Comment by Tobias Heimann (Killaruna) - Wednesday, 22 November 2006, 01:19 GMT
OK, I see... I've put these characters to the end of the alphabet again - thanks for the feed-back!
Comment by Rani Hod (RaeNye) - Wednesday, 29 November 2006, 14:05 GMT
Are you considering default codepage for that?
the same byte values stand for different characters in other codepages (non-unicode) so you should know how to interpret the values...
Comment by Michael Sevakis (MikeS) - Wednesday, 29 November 2006, 19:54 GMT
Why are we using anything but Unicode internally? :\\ I'd like a good reason that can't possibly have a good solution and compels the use of codepages.

HINT: The good solution isn't "use codepages" ;)
Comment by Jonas Häggqvist (rasher) - Friday, 22 August 2008, 22:26 GMT
Collation is language-specific, so there's no general purpose solution here.