Rockbox

This is the bug/patch tracker for Rockbox. Click here for more information.

Quick links: Bugs · Patches · Rockbox frontpage

Tasklist

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

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

Details

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.
   latin1_sorted_filetree.patch (3.6 KiB)
 apps/filetree.c |   59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 57 insertions(+), 2 deletions(-)

This task depends upon

Closed by  Jonathan Gordon (jdgordon)
Thursday, 14 October 2010, 14:21 GMT+2
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, 01:52 GMT+2
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, 02:28 GMT+2
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, 02:34 GMT+2
I believe those should be moved to be directly after z, as this is the case in all languages which use them (http://en.wikipedia.org/wiki/Danish_and_Norwegian_alphabet and http://en.wikipedia.org/wiki/Swedish_alphabet). Æ, ø 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, 02:19 GMT+2
OK, I see... I've put these characters to the end of the alphabet again - thanks for the feed-back!
   latin1_sorted_filetree-b.patch (3.6 KiB)
 apps/filetree.c |   59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 57 insertions(+), 2 deletions(-)

Comment by Rani Hod (RaeNye) - Wednesday, 29 November 2006, 15:05 GMT+2
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, 20:54 GMT+2
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) - Saturday, 23 August 2008, 00:26 GMT+2
Collation is language-specific, so there's no general purpose solution here.

Loading...