You are not logged in.

#1 2015-08-12 16:33:59

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

[solved][pebkac]'LC_ALL=C locale' changes almost all fields to "C".

Can anyone tell me what's going on here:

$ LC_ALL=C locale
LANG=en_XX.UTF-8@POSIX
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEPHONE="C"
LC_MEASUREMENT="C"
LC_IDENTIFICATION="C"
LC_ALL=C
$ locale
LANG=en_XX.UTF-8@POSIX
LC_CTYPE=en_US.UTF-8
LC_NUMERIC="en_XX.UTF-8@POSIX"
LC_TIME="en_XX.UTF-8@POSIX"
LC_COLLATE="en_XX.UTF-8@POSIX"
LC_MONETARY="en_XX.UTF-8@POSIX"
LC_MESSAGES="en_XX.UTF-8@POSIX"
LC_PAPER="en_XX.UTF-8@POSIX"
LC_NAME="en_XX.UTF-8@POSIX"
LC_ADDRESS="en_XX.UTF-8@POSIX"
LC_TELEPHONE="en_XX.UTF-8@POSIX"
LC_MEASUREMENT="en_XX.UTF-8@POSIX"
LC_IDENTIFICATION="en_XX.UTF-8@POSIX"
LC_ALL=

It used to work. Me sad.

Last edited by karol (2015-08-13 08:28:04)

Offline

#2 2015-08-12 17:30:16

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: [solved][pebkac]'LC_ALL=C locale' changes almost all fields to "C".

I have never had cause to use LC_ALL=C, so I don't know what is wrong. But a new glibc hit the repos just a few days ago.


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#3 2015-08-12 17:35:55

alex.theoto
Member
From: Athens Greece
Registered: 2014-11-30
Posts: 307

Re: [solved][pebkac]'LC_ALL=C locale' changes almost all fields to "C".

Did you set your language on

/etc/locale.gen
/etc/locale-gen ### run it to config your locale.gen
/etc/locale.conf ### to set your language

Offline

#4 2015-08-12 17:38:29

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

Re: [solved][pebkac]'LC_ALL=C locale' changes almost all fields to "C".

Is downgrading glibc a bad idea?

alex.theoto wrote:

Did you set your language on

/etc/locale.gen
/etc/locale-gen ### run it to config your locale.gen
/etc/locale.conf ### to set your language

Sure. Are you seeing different results?

Offline

#5 2015-08-12 17:44:16

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: [solved][pebkac]'LC_ALL=C locale' changes almost all fields to "C".

karol wrote:

Is downgrading glibc a bad idea?

All I can say is that nearly everything links to libc, so I wasn't willing to try it. wink


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#6 2015-08-12 17:51:34

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

Re: [solved][pebkac]'LC_ALL=C locale' changes almost all fields to "C".

glibc 2.22-1 hit the non-testing repos  just a few hours ago, so maybe some users haven't updated yet and can test it.
I can always open a bug report.

Offline

#7 2015-08-12 17:56:06

loqs
Member
Registered: 2014-03-06
Posts: 13,879

Re: [solved][pebkac]'LC_ALL=C locale' changes almost all fields to "C".

glibc 2.21-4 seeing the same result as karol

Offline

#8 2015-08-12 17:58:58

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: [solved][pebkac]'LC_ALL=C locale' changes almost all fields to "C".

karol wrote:

glibc 2.22-1 hit the non-testing repos  just a few hours ago, so maybe some users haven't updated yet and can test it.

Good to know. I always just assumed the package "Build Date" roughly reflected the time it entered the standard repos.

Last edited by alphaniner (2015-08-12 17:59:36)


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#9 2015-08-12 18:02:29

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

Re: [solved][pebkac]'LC_ALL=C locale' changes almost all fields to "C".

alphaniner wrote:
karol wrote:

glibc 2.22-1 hit the non-testing repos  just a few hours ago, so maybe some users haven't updated yet and can test it.

Good to know. I always just assumed the package "Build Date" roughly reflected the time it entered the standard repos.

Since glibc goes through [testing], 'Last Updated' is the time it became available in the regular repos:
https://www.archlinux.org/packages/core/i686/glibc/

Build Date:     2015-08-06 04:41 UTC
Last Updated:     2015-08-12 04:51 UTC

Offline

#10 2015-08-12 21:05:39

bernarcher
Forum Fellow
From: Germany
Registered: 2009-02-17
Posts: 2,281

Re: [solved][pebkac]'LC_ALL=C locale' changes almost all fields to "C".

This must be some bug in the locale reporting code recently.

bp:~% locale -a
C
de_DE
de_DE@euro
de_DE.iso88591
de_DE.iso885915@euro
de_DE.utf8
deutsch
en_US
en_US.iso88591
en_US.utf8
eo
eo.utf8
german
POSIX

Obviously it simply replaces the LC_ALL argument with the real locale used:

bp:~% LC_ALL=deutsch locale
LANG=de_DE.utf8
LC_CTYPE="deutsch"
LC_NUMERIC="deutsch"
LC_TIME="deutsch"
LC_COLLATE="deutsch"
LC_MONETARY="deutsch"
LC_MESSAGES="deutsch"
LC_PAPER="deutsch"
LC_NAME="deutsch"
LC_ADDRESS="deutsch"
LC_TELEPHONE="deutsch"
LC_MEASUREMENT="deutsch"
LC_IDENTIFICATION="deutsch"
LC_ALL=deutsch

which is unusual but o.k. But it may as well report shere nonsense:

bp:~% LC_ALL=shit locale  
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=de_DE.utf8
LC_CTYPE="shit"
LC_NUMERIC="shit"
LC_TIME="shit"
LC_COLLATE="shit"
LC_MONETARY="shit"
LC_MESSAGES="shit"
LC_PAPER="shit"
LC_NAME="shit"
LC_ADDRESS="shit"
LC_TELEPHONE="shit"
LC_MEASUREMENT="shit"
LC_IDENTIFICATION="shit"
LC_ALL=shit

Never seen this before. But on the other hand, locale appears to work as wanted otherwise.

Last edited by bernarcher (2015-08-12 21:06:08)


To know or not to know ...
... the questions remain forever.

Offline

#11 2015-08-12 21:14:43

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

Re: [solved][pebkac]'LC_ALL=C locale' changes almost all fields to "C".

Offline

#12 2015-08-12 21:22:06

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: [solved][pebkac]'LC_ALL=C locale' changes almost all fields to "C".

I'm still curious, what is the expected behaviour?


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#13 2015-08-12 21:27:14

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

Re: [solved][pebkac]'LC_ALL=C locale' changes almost all fields to "C".

alphaniner wrote:

I'm still curious, what is the expected behaviour?

It prints the messages in English:

~ $ LC_ALL=de_DE pacman -Syu
Fehler: Sie bentigen Root-Rechte, um diese Operation auszufhren.
~ $ LC_MESSAGES=de_DE pacman -Syu
Fehler: Sie benötigen Root-Rechte, um diese Operation auszuführen.
~ $ LC_MESSAGES=C pacman -Syu
error: you cannot perform this operation unless you are root.

It makes the debugging / googling easier, since we speak English here.

I've noticed that LC_ALL=de_DE doesn't print the umlauts, while LC_MESSAGES=de_DE does, although that doesn't matter for English (and 'C' uses English).

Offline

#14 2015-08-12 21:33:10

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: [solved][pebkac]'LC_ALL=C locale' changes almost all fields to "C".

Sorry, I mean what is the expected output of 'LC_ALL=C locale'?


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#15 2015-08-12 21:36:31

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

Re: [solved][pebkac]'LC_ALL=C locale' changes almost all fields to "C".

alphaniner wrote:

Sorry, I mean what is the expected output of 'LC_ALL=C locale'?

Depends on your locale :-)
For me, it should say

LANG=en_XX.UTF-8@POSIX
LC_CTYPE=en_US.UTF-8
LC_NUMERIC="en_XX.UTF-8@POSIX"
LC_TIME="en_XX.UTF-8@POSIX"
LC_COLLATE="en_XX.UTF-8@POSIX"
LC_MONETARY="en_XX.UTF-8@POSIX"
LC_MESSAGES="en_XX.UTF-8@POSIX"
LC_PAPER="en_XX.UTF-8@POSIX"
LC_NAME="en_XX.UTF-8@POSIX"
LC_ADDRESS="en_XX.UTF-8@POSIX"
LC_TELEPHONE="en_XX.UTF-8@POSIX"
LC_MEASUREMENT="en_XX.UTF-8@POSIX"
LC_IDENTIFICATION="en_XX.UTF-8@POSIX"
LC_ALL=C

LC_ALL=C is used to display errors in English e.g. https://bbs.archlinux.org/viewtopic.php?id=200990

$ locale
locale: Kan inte stta LC_ALL till standardlokalen: Filen eller katalogen finns inte
LANG=sv_SE.UTF-8

<snip>

Offline

#16 2015-08-12 21:44:55

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: [solved][pebkac]'LC_ALL=C locale' changes almost all fields to "C".

It's my understanding that the value of LC_ALL overrides all other LC_ vars. So isn't locale correct in reporting them all as being "C" when run as 'LC_ALL=C locale'?

Last edited by alphaniner (2015-08-12 21:45:34)


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#17 2015-08-12 21:46:15

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

Re: [solved][pebkac]'LC_ALL=C locale' changes almost all fields to "C".

alphaniner wrote:

It's my understanding that the value of LC_ALL overrides all other LC_ vars. So isn't locale correct in reporting them all as being "C"?

No, it should only display the output in English.

See also https://bbs.archlinux.org/viewtopic.php … 0#p1552780

Offline

#18 2015-08-12 21:55:29

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: [solved][pebkac]'LC_ALL=C locale' changes almost all fields to "C".

But why does LC_ALL=C cause output to be displayed in english? Because it overrides LC_<everything else>. It overrides LANGUAGE if set to 'C' or 'POSIX', but not if set to anything else. Which may have something to do with the error messages when it's set to eg 'foo'.

See eg this

Last edited by alphaniner (2015-08-12 22:00:46)


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#19 2015-08-12 22:00:20

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

Re: [solved][pebkac]'LC_ALL=C locale' changes almost all fields to "C".

It used to work in a different manner, now it is IMHO somewhat glitched, but it's not the end of the world. If I want to read the errors in English but want to know what locale is somebody using, I'm going to ask them for the output of 'LC_MESSAGES=C locale':

$ LC_MESSAGES=C locale
LANG=en_XX.UTF-8@POSIX
LC_CTYPE=en_US.UTF-8
LC_NUMERIC="en_XX.UTF-8@POSIX"
LC_TIME="en_XX.UTF-8@POSIX"
LC_COLLATE="en_XX.UTF-8@POSIX"
LC_MONETARY="en_XX.UTF-8@POSIX"
LC_MESSAGES=C
LC_PAPER="en_XX.UTF-8@POSIX"
LC_NAME="en_XX.UTF-8@POSIX"
LC_ADDRESS="en_XX.UTF-8@POSIX"
LC_TELEPHONE="en_XX.UTF-8@POSIX"
LC_MEASUREMENT="en_XX.UTF-8@POSIX"
LC_IDENTIFICATION="en_XX.UTF-8@POSIX"

Offline

#20 2015-08-13 01:26:19

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,044
Website

Re: [solved][pebkac]'LC_ALL=C locale' changes almost all fields to "C".

So what exactly are you considering a bug here?

$ LC_ALL=C locale
LANG=en_AU.UTF-8
LC_CTYPE="C"
LC_NUMERIC="C"

The fact LANG is not changed?


Edit:   Going from the topic:    'LC_ALL=C locale' changes almost all fields to "C"
That is supposed to happen.   What do you think "ALL" means?

Offline

#21 2015-08-13 08:25:09

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

Re: [solved][pebkac]'LC_ALL=C locale' changes almost all fields to "C".

I guess I mis-remembered it working the way LC_MESSAGES do, but I did find older post on another forum http://unixforum.org/index.php?showtopic=125707 which shows that LC_ALL=C has worked the way it does now at least for some time.

Since 'LC_MESSAGES=C' prints

$ LC_MESSAGES=C locale
LANG=en_XX.UTF-8@POSIX
LC_CTYPE=en_US.UTF-8
LC_NUMERIC="en_XX.UTF-8@POSIX"
LC_TIME="en_XX.UTF-8@POSIX"
LC_COLLATE="en_XX.UTF-8@POSIX"
LC_MONETARY="en_XX.UTF-8@POSIX"
LC_MESSAGES=C
LC_PAPER="en_XX.UTF-8@POSIX"
LC_NAME="en_XX.UTF-8@POSIX"
LC_ADDRESS="en_XX.UTF-8@POSIX"
LC_TELEPHONE="en_XX.UTF-8@POSIX"
LC_MEASUREMENT="en_XX.UTF-8@POSIX"
LC_IDENTIFICATION="en_XX.UTF-8@POSIX"
LC_ALL=

you may be absolutely right that things are working as expected and I've had a brainfart.

Sorry for the noise.

Offline

Board footer

Powered by FluxBB