Re: [Nautilus-list] bug or feature? file list order



Darin Adler wrote:
> > It's not strange. This is not ASCII sorting, it's sorting based on
> > actual lexigraphical sorting rules for the language/locale, in other
> > words what you'd expect from any paper index. Non-alphanumeric
> > characters cannot be ordered lexigraphically, so they are ignored.
> > If you want ASCII sorting (based on ASCII value), use the C locale.
> > LC_COLLATE is the variable that controls sorting, so make sure
> > LC_COLLATE is "C" in that case (also make sure you unset LC_ALL, else
> > you won't be able to change LC_COLLATE).
> 
> I understand what "actual lexigraphical sorting" is.
> 
> Ignoring all non-alphanumeric characters is not the most useful behavior.
> I want sorting that's useful for a human being, but that also acknowledges
> that there are characters other than alphanumerics. I'm sad to discover
> that strcoll simply ignores any non-alphanumeric characters.

I see your point, from the Nautilus perspective. However, strcoll is
used for more than file name comparisons, and has to sort by the book.
It cannot determine sorting for non-alphanumeric characters, because
there simply are no rules for that in most locales. There's no "right"
or "wrong" way of sorting non-alphanumeric characters.

I agree that for example a deterministic sorting of underscores, dots,
hash marks and other characters that are not uncommon in file names
could be useful in a file manager. This sorting however has to be done
by the application, since it's only the application that knows how it
wants these sorted and for what purpose. Nautilus (or gnome-vfs?) could
have sorting routines that detected some common non-alphanumeric
characters and sorted them according to ASCII, and then passed on the
rest for further sorting by strcoll(). However, I still think this
should be optional. Maybe an option like "Sort non-alphanumeric
characters" in the preferences.


Christian




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]