You are not logged in.

#1 2016-09-22 20:04:49

0112358
Member
Registered: 2012-04-09
Posts: 38

[SOLVED] Cannot set locale properly (setting ignored or overridden)

Locale seems to have somehow become misconfigured in my system.  It should be set to en_US.UTF-8 but the setting doesn't seem to stick using either localectl or editing /etc/locale.conf (see output below).  This is causing urxvt to drop unicode support.  Can anyone tell me what might be causing this?  I looked through some previous threads with similar problems but the issues people seemed to uncover don't apply to me - I don't see any error messages, I'm not running a DE, and it's a recently recent installation (~six months).

-> locale
LANG=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=

-> locale -a
C
POSIX
en_US.utf8

-> localectl
   System Locale: LANG=en_US.UTF-8
       VC Keymap: n/a
      X11 Layout: n/a

-> localectl list-locales
en_US.utf8

-> cat /etc/locale.conf 
LANG=en_US.UTF-8

-> sudo locale-gen
Generating locales...
  en_US.UTF-8... done
Generation complete.

-> sudo localectl set-locale LANG=en_US.UTF-8

-> locale
LANG=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=

The only thing that works is to manually set the env var and launch urxvt from within itself:

-> echo $LANG

-> export LANG=en_US.UTF-8

-> echo $LANG
en_US.UTF-8

-> urxvt &

Last edited by 0112358 (2016-09-22 21:48:34)

Offline

#2 2016-09-22 20:41:46

alxndr13
Member
Registered: 2016-09-22
Posts: 13

Re: [SOLVED] Cannot set locale properly (setting ignored or overridden)

Rights on /etc/locale.conf are okay?

Offline

#3 2016-09-22 20:47:53

0112358
Member
Registered: 2012-04-09
Posts: 38

Re: [SOLVED] Cannot set locale properly (setting ignored or overridden)

alxndr13 wrote:

Rights on /etc/locale.conf are okay?

-> ls -al /etc/locale.conf
-rw-r--r-- 1 root root 17 Feb 14  2016 /etc/locale.conf

Should be right, no?  Just read permissions necessary.

Last edited by 0112358 (2016-09-22 21:17:44)

Offline

#4 2016-09-22 21:26:49

ayekat
Member
Registered: 2011-01-17
Posts: 1,589

Re: [SOLVED] Cannot set locale properly (setting ignored or overridden)

Perhaps you accidentally set the LANG variable to something (empty) somewhere. Is the locale still correct when you only log into a TTY (without X11)?

If yes, it might be related to your .xinitrc (or however you start X11).
If no, it might be something in your shell initialisation (.bashrc, .bash_profile, .zshrc, .zshenv, ... or maybe you modified something in the global shell initialisation files in /etc?).


pkgshackscfgblag

Offline

#5 2016-09-22 21:48:02

0112358
Member
Registered: 2012-04-09
Posts: 38

Re: [SOLVED] Cannot set locale properly (setting ignored or overridden)

ayekat wrote:

If no, it might be something in your shell initialisation (.bashrc, .bash_profile, .zshrc, .zshenv, ... or maybe you modified something in the global shell initialisation files in /etc?).

Thanks, that was a helpful direction to look.  I use fish and it was still happening before running startx, but changing my default shell to bash and rebooting fixed it.  It appears this is an issue with fish and there might be some workarounds, so I'll mark this as solved.

https://github.com/fish-shell/fish-shell/issues/3092

Offline

Board footer

Powered by FluxBB