Bug 105057

Summary: Incorrect sorting of filenames
Product: [Applications] konqueror Reporter: Darrell Esau <desau>
Component: generalAssignee: Konqueror Developers <konq-bugs>
Status: RESOLVED WORKSFORME    
Severity: normal CC: aben, jens-bugs.kde.org
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: screenshot showing sort order bug

Description Darrell Esau 2005-05-03 23:09:25 UTC
Version:            (using KDE KDE 3.4.0)
Installed from:    Fedora RPMs
OS:                Linux

Sort order of files is not correct when using case insensitive sorting.

Create a new directory with three files:

Apple.i
AppleBerry.i
AppleOrange.i

When sorted with case-insensitive sort, the order is:

AppleBerry.i
Apple.i
AppleOrange.i

I can see no reason why these would be sorted in this order (either case-sensitive or case-insensitive).  Case-sensitive sort seems to work correctly.
Comment 1 Thiago Macieira 2005-05-04 03:31:47 UTC
I can't confirm. It is working fine here.

What is your LANG set to?
Comment 2 Darrell Esau 2005-05-04 03:41:53 UTC
LANG is en_US.UTF-8

-d

Thiago Macieira wrote:

[bugs.kde.org quoted mail]
Comment 3 Jens 2005-05-25 10:07:59 UTC
Created attachment 11191 [details]
screenshot showing sort order bug

Hi,

I have a similar problem. See attached screenshot: The names all start with
"drossel", but are not sorted at all (in a way).

drossel+anker+...  is first, then one with "-":
drossel_anker....  then another with "+"
drossel+anker....  etc.

This seems not to be sorted at all, at least regarding special characters (as
in "+", "_" here).

Thanks for investigating this ;)

Jens
Comment 4 Misha Aizatulin 2005-06-22 00:15:51 UTC
I suppose this is related to Bug 61989.

The solution was that it is caused by behavior of strcoll() in some locales and perhaps is even a feature. I myself have 
LANG=en_GB.UTF-8
LC_CTYPE="en_GB.UTF-8"
and also have this problem. 

Mischa
Comment 5 Misha Aizatulin 2005-06-22 01:42:34 UTC
You could try

export LC_COLLATE=C

This way strcoll() behaves better. 
Comment 6 Tommi Tervo 2005-10-28 14:41:58 UTC
*** Bug 104689 has been marked as a duplicate of this bug. ***
Comment 7 Tony A 2005-11-14 21:59:51 UTC
I can confirm this wrong behaviour. One example from my music folder (there are many others) - Konqueror sorts the names as follows:
...
Chic - Good Times.mp3
Chicken Shack - I Rather Go Blind.mp3
Chic - Le Freak.mp3

It looks like Konq ignores all spaces and special characters and takes only letters and numbers into account when sorting.
Btw: Other file managers, like Nautilus or Rox filer and even ls in a terminal, also show the files in the same wrong order.
Comment 8 Philip Rodrigues 2006-09-02 18:09:57 UTC
Can those who have reproduced this problem please see if 'ls' shows the same sort order, and whether LC_COLLATE=C helps (as described in comment #5). It sounds like this isn't a KDE bug
Comment 9 Philip Rodrigues 2006-11-19 17:40:23 UTC
Has anyone tried the suggestion in comment 8?
Comment 10 Philip Rodrigues 2006-12-11 23:40:41 UTC
Feedback timeout, but please reopen this report if you have the answers to the questions in comment 8