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 _______________________________________________ Bug-coreutils mailing list [email protected] http://lists.gnu.org/mailman/listinfo/bug-coreutils
