bug-coreutils
[Top][All Lists]
Advanced

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

Re: sort order changed in "sort" and "ls".


From: Bob Proulx
Subject: Re: sort order changed in "sort" and "ls".
Date: Fri, 13 Mar 2009 14:50:48 -0600
User-agent: Mutt/1.5.13 (2006-08-11)

Eric Blake wrote:
> Bob Proulx wrote:
> > With no LANG nor LC_* variables set the default locale is the
> > traditional C locale.  This is also standardized by POSIX and is also
> > known as the POSIX locale.  The strings "C" and "POSIX" are equivalent
> > but most typically us traditionalists use "C" as an emphasis that it
> > is the traditional behavior that we are setting.  Setting LANG=C is
> > the same as not setting it at all.
> 
> Not necessarily true.  POSIX allows systems to choose an
> implementation-defined default if LANG is unset, and Bruno has made
> reports of some systems being localized in spite of not having any locale
> variables set.

Argh.  That is unfortunate.  Oh well.

> Off-hand, I'm not sure which systems default to C when all
> variables are unset, vs. systems where unset can still imply localization.

I am pretty sure the original poster was operating from a Debian
system and Debian defaults to C when nothing is set.  But since there
are other examples of systems that don't default that way then I agree
that it can't be counted upon in general.

> But the net result is that if you want to guarantee anything, you MUST
> set at least one of the three levels of locale variables.

Yep.  With your information I agree.  Thanks for the correction.

> > Then you *must* have had LANG or LC_COLLATE set.  You can print your
> > locale settings with the 'locale' command.

[Language parsing note.  I meant that because of the behavior seen I
deduce that either LANG or LC_COLLATE or LC_ALL must have been set.
Not that you must set it.  I see now that it reads ambiguously.]

> >   $ locale
> 
> The locale command is required to report your default locale, even
> if all three levels of variables are unset but the system defaults
> to a non-C locale.

Yep.  That is fine.

Bob




reply via email to

[Prev in Thread] Current Thread [Next in Thread]