3

enter image description here

By what logic does the kálmán track appear where it does? (I have the view sorted by filename) Where is this sort behaviour defined and is there anyway to change this behaviour?

wim
  • 13,148
  • 1
    Doesn't help you directly but Nautilus is known not to honour the system-wide LC_COLLATE environment variable which is supposed to define this stuff. See: http://askubuntu.com/questions/280834/nautilus-sort-order-with-ls and its bug report – Oli Apr 15 '13 at 13:28
  • 1
    +1 Weird way of sorting. I even took my time creating the same files you have. Same "sorted" list. This will create many problems for non english systems. I even took the accent out of the A and still kept sorting them wrong. – Luis Alvarado Apr 15 '13 at 13:30
  • I have a hunch that accented characters are decoded to ascii, and non alphanumeric characters are ignored. But it's just a wild guess. – wim Apr 15 '13 at 13:33

1 Answers1

3

Actually comment #4 on that bug report says that if you use /etc/environment, Nautilus might follow it. Worth a go... This should copy that over:

echo LC_COLLATE=\"$LC_COLLATE\" | sudo tee -a /etc/environment

You might have to restart. And it might not work at all. And you'll have to replace the setting in /etc/environment if you ever change locale.

Oli
  • 299,936
  • I don't think it has anything to do with LC_COLLATE. It seems to me to be a bug in glib's utf8_collate(), utf8_collate_key(), and utf8_collate_key_for_filename() methods (most likely the latter of those three), causing the problem. It's not that LC_COLLATE is ignored, or that you need to add it to /etc/environment, but simply that the UTF-8 sorting code has a bug. Also, note from https://developer.gnome.org/glib/unstable/glib-Unicode-Manipulation.html#g-utf8-collate-key-for-filename that . is treated specially here. And it appears hidden files are sorted after visible files. – dobey Apr 15 '13 at 13:52
  • I can verify that setting LC_COLLATE in /etc/environment does indeed effect Nautilus. It used to work for me by simply setting it in ~/bashrc (or (bash_aliases), but when that stopped to work for me, I put it in /etc/environment and it came back; I just set LC_COLLATE=C. You do have to restart for it to take effect. – karlespy Nov 04 '13 at 05:54