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



Darin Adler wrote:
> On Friday, May 25, 2001, at 01:39  PM, Jens Ansorg wrote:
> > just noticed an something odd:
> >
> > i have some files and directories whose names start with _ (underscore)
> >
> > Now, nautilus kind of ignores this "letter" and sorts the files/dirs
> > using the following letter, i.e.
[snip]
> >
> > at least that seems logical to me and that's what I'm used from other
> > OSes
> >
> > any chance to change this behaviour?
> 
> Interesting. I didn't expect this strange sorting rule, but the sorting
> rule comes from the underlying glibc sorting functions, specifically
> strcoll, and depends on the locale. If necessary, we can add a layer on
> top of strcoll that overrides this strange behavior.

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).


> You might want to make yourself a test program and verify that the strcoll
> on your glibc has this behavior.

Or you can play around testing this with the shell. Make a sample of
test files with strange file names and play around with "ls -a | sort"
and different settings on LC_COLLATE.
On my system, I don't even have to pipe ls through sort, I get correctly
sorted results (according to my Swedish locale) directly from ls.


Christian




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