Version: 1.3 (using KDE 4.3.1) OS: Linux Installed from: Fedora RPMs Deaspite I'm running a system wide LC_COLLATE="C" setting, Dolphin is showing the file lists with case insensitive sorting, which is not "C" collation.
I think this is a bigger problem than Dolphin. My mail folders in KMail are also sorted case insentively, event though I have LC_COLLATE=POSIX. Also, konqueror is doing a case insensitive sort, just like dolphin. It wouldn't surprise me if there were multiple places in KDE that are ignoring LC_COLLATE.
This is not a wishlist item. It is 1) a violation of spec 2) a regression from KDE 3.x
This has been reported as Bug 148550, 176185, 199238 ------- Comment #3 From Peter Penz 2007-12-03 12:26:22 ------- Yes, this feature is missing currently and we'll try to fix this in 4.1.
We all users hope for a backport of this fix as we think it should not be a huge one.
Well, as of v2.0 (KDE v4.8.0) the bug is still here. And getting more and more annoying.
Resetting assignee to default as per bug #305719
Steps to reproduce: 1. Open a Konsole, and run: “LC_COLLATE=C dolphin”. 2. From the new Dolphin window, go to a test folder, open the built-in terminal (F4), and run: “touch A B a b”. 3. Check how the files in Dolphin are ordered as “a A b B”. 4. In the built-in terminal, run “ls”. Check how the “ls” command succeds in showing the files ordered as “A B a b”.
Seems that dolphin uses QString::compare to compare file names. So it is either QString:compare should respect the LC_COLLATE environment variable (which will probably not be acceptable since it may be considered a api breaking) or all item name sorting in any item view's (not only dolphin but also in other item views like systemsettings.) should use a different function to compare strings which will be a lot of work (but maybe either Qt or kdelibs should provide/have already provided this function?).
Is that just QString::localeAwareCompare() ??
Would like to note this is also a problem with international characters. I am living in Denmark and am affected by this problem with the Danish characters æ, ø and å. In a terminal all is fine: touch a b o p z æ ø å Running ls correctly give: a b o p z æ ø å in dolphin (and also file dialogs from e.g. kate) the sorting will be: a å æ b o ø p z This is annoying but usable for people like me who understand it (and as long time habbit normally only use ascii chars for filenames), but for the average user who are not aware of it, they might not be able to find their files.
Same issue in Japanese locale. My Dolphin version is KDE 4.11.5/Gentoo amd64. "Sort By Name" is able to handle Japanese by head letter at LANG="en_US.UTF-8" LC_COLLATE="C" environment, however Dolphin groups each Japanese character into the category A at LANG="ja_JP. UTF-8" LC_COLLATE="C" environment. Here is the screenshot http://goo.gl/18UUuT
Hi everyone, can someone please test it with the latest Dolphin from frameworks branch? If not, it would be awesome if someone can test it with the next Dolphin release 15.04 (will be released in about 3 months) and give a short feedback if it works now. Thanks in advance! Dolphin (currently only frameworks branch, because it is Qt5 only) uses QCollator [1] for sorting now. [1] http://doc.qt.io/qt-5/qcollator.html
Well, not all is peachy. The 'C' locale seems to be properly collated, but other locales (e.g. 'en_US.utf8') are not.
Created attachment 102485 [details] C locale working properly Dolphin 16.08.3 Qt 5.6.1 KF 5.28.0
Created attachment 102486 [details] C locale working properly on some weird file names Dolphin 16.08.3 Qt 5.6.1 KF 5.28.0
Created attachment 102487 [details] en_US.utf8 locale breaking on some weird file names Dolphin 16.08.3 Qt 5.6.1 KF 5.28.0
Created attachment 102506 [details] Proposed patch Seems like QCollator was only used for natural sorting for some reason, falling back to QString::compare in the other cases, i.e. C-locale collating. I will have to research this reason to make sure that we don't break anything.
Created attachment 102626 [details] Revised patch According to QtBug #17104 [1], LC_COLLATE is ignored by Qt. Something along the lines of m_collator.setLocale(QProcessEnvironment::systemEnvironment().value("LC_COLLATE")); could be used instead, although it's a tad ugly. But then I'm hitting another bug: with LC_COLLATE=C the QCollator is properly set to collate using the C-locale but the comparisons are wrong. E.g. even QCollator(QLocale("C")).compare("A", "a"); returns 1 for me, instead of a negative value. Of course we could fall back to QString::compare in this specific case (C-locale), but this is ugly as well. I am not gonna pursue this any further, I leave my code & research here in case anyone is interested to pick it up. [1] https://bugreports.qt.io/browse/QTBUG-17104
There is some additional information in: https://bugreports.qt.io/browse/QTBUG-58621 (possible fix in Qt 5.12.1) and https://bugreports.qt.io/browse/QTBUG-67661 Dolphin 18.12.0, openSUSE Tumbleweed Possibly related to bug 217814
As of today, Dolphin is still behaving weirdly. Dolphin version: 21.12.3 KDE Frameworks Version: 5.92.0 Qt Version: 5.15.3 I created 4 file with this command: touch a A b B Then I have started dolphin in that very directory with this command: LC_COLLATE=C dolphin . Collation is completely ignored and files are sorted as: A a B b. Directories are placed *before* files. I then configure dolphin to use "Sorting mode: Alphabetical, case sensitive" (default is some unknown "Natural" mode) and restarted dolphin, with the very same command line. Now dolphin displays those four files in the correct order (A B a b) while still displaying directory names *before* files. I am attaching a screenshot to document this last use case.
Created attachment 148015 [details] Alphabetical order, case sensitive
Affected by this issue too. Moreover, if i set LC_COLLATE to en_US(and leave other LC_* and LANG variables untouched) Dolphin SWITCHES to English! But if i set LC_COLLATE=C(still not touching other language-specific variables) - Dolphin is displayed in proper language, but natural sorting is broken