You are not logged in.

#1 2009-12-17 21:28:25

vexxor
Member
Registered: 2008-07-17
Posts: 45

New LC_COLLATE behaviour

Hello,

With the new LC_COLLATE change (http://www.archlinux.org/news/476/) my sort order went crazy. When I looked into it, I came to the following conclusion:

1) If I kept the old way of sorting (LC_COLLATE=C), the file names beginning with Croatian characters were indeed sorting incorrectly
2) The new way ignores leading special characters (including the . in hidden files) when sorting, which messes up the way my brain is conditioned to work smile

The new sort order is unacceptable for me. I have reverted the behaviour, but I'm left wondering is there a way to get the best of both worlds? Can I somehow instruct the locale "en_US.utf8" not to ignore leading special characters when sorting?

Offline

#2 2009-12-17 22:16:59

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: New LC_COLLATE behaviour

What is your current (new) LC_COLLATE=?

Offline

#3 2009-12-18 10:43:41

vexxor
Member
Registered: 2008-07-17
Posts: 45

Re: New LC_COLLATE behaviour

karol wrote:

What is your current (new) LC_COLLATE=?

After the update it was:

LC_COLLATE="en_US.utf8"

I changed it back to

LC_COLLATE=C

Last edited by vexxor (2009-12-18 10:44:36)

Offline

#4 2009-12-18 13:17:54

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: New LC_COLLATE behaviour

Why not use the Croatian collation?
Can you tell me how do you look at your files? I use 'ls -Aog -h --group-directories-first --color'; '-group-directories-first' modifies the order.

Offline

#5 2009-12-18 13:34:52

vexxor
Member
Registered: 2008-07-17
Posts: 45

Re: New LC_COLLATE behaviour

karol wrote:

Why not use the Croatian collation?

My locale in rc.conf is set to en_US.utf8

I was under the impression that if i changed it to say, Croatian, all my month names, day names, etc. would become their Croatian equivalents, and I didn't want this. The collation was set to "en_US.utf8" throught the upgrade, probably in accordance to my system wide setting.


karol wrote:

Can you tell me how do you look at your files? I use 'ls -Aog -h --group-directories-first --color'; '-group-directories-first' modifies the order.

this is my ls alias:

alias ls='ls -lh --group-directories --color=auto'

The problem is that special characters, like for example "_" don't get sorted first anymore.

With LC_COLLATE=C:

_bdir
adir
cdir

With new setting:

adir
_bdir
cdir


This is not limited to directories. I am keeping it the old way because i use prefixes on some dirs, files or symlinks to keep them on top of listings.

Offline

#6 2009-12-18 15:04:27

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: New LC_COLLATE behaviour

> I was under the impression that if i changed it to say, Croatian (...)
Did you try it? Apart from LC_COLLATE there's a bunch of other options that control the currency etc. Type 'locale' to have a look.

Offline

#7 2009-12-18 15:09:27

vexxor
Member
Registered: 2008-07-17
Posts: 45

Re: New LC_COLLATE behaviour

karol wrote:

> Did you try it? Apart from LC_COLLATE there's a bunch of other options that control the currency etc. Type 'locale' to have a look.

Yes i tried after i posted. When I set the whole thing to "hr_HR.utf8", i did indeed get croatian month and day names, and other options you mention. This is not what I really need, so i reverted it.

The LC_COLLATE option seems to function the same when set to "hr_HR.utf8" as it does when it's set to "en_US.utf8", so there's still the original problem with that.

Offline

#8 2009-12-18 15:26:07

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: New LC_COLLATE behaviour

Did you try 'export LC_ALL=hr_HR.utf8'?
Or maybe you should comment out the LC_COLLATE in your /etc/profile - http://bugs.archlinux.org/task/15250#comment48369

Pierre Buard wrote:

I haven't seen any problem on 2 workstations for nearly 2 month with 'LC_COLLATE="C"' commented in my /etc/profile.
An interesting side effect is that the GNOME Open/Save dialog now sorts the folders correctly regardless of the case (i.e. the smaller case folders were always sorted after the capitalized ones).

Offline

#9 2009-12-29 17:45:39

cro
Member
From: Germany
Registered: 2006-01-02
Posts: 101

Re: New LC_COLLATE behaviour

I have similar problems since LC_COLLATE="C" was removed out of /etc/profile: Crazy sort order in konqueror and so on.
I sometimes use a leading "_" to have a second "naming layer" in my directories, so I depend that those are sorted at the beginning or at least together.
Is it traditional english sort order to ignore leading special characters??

1. I am one of those user that have problems with standard localizations. I want English as language only but region Germany and german formats and stuff as default.
2. Where can I set my user locale or change LC_ variables, so that all my applications use it. The system-wide setting is in rc.conf, ok. But is ~/.bashrc not only for bash and things I start from bash? But isn't /etc/profile only for bash, too? And what is with GUI applications like konqueror when I don't start them from bash?

Btw. http://wiki.archlinux.org/index.php/Con … ide_locale seems to be outdated because it talks of LC_COLLATE="C" in /etc/profile.

Offline

Board footer

Powered by FluxBB