You are not logged in.

#1 2014-12-26 10:17:13

ciolkovszkij
Member
Registered: 2014-12-26
Posts: 5

[SOLVED] locale config has no effect

Hi,

I followed the instructions on the arch wiki page on locales to set up a utf-8 aware locale, however it has no effect.

➜  /tmp  touch őúű  
➜  /tmp  ls  
??????
➜  /tmp  echo *
őúű
➜  /tmp  LANG=en_US.UTF-8 ls
őúű

My locale settings so far:

➜  ~  cat /etc/locale.gen | grep -v '^#'
en_US.UTF-8 UTF-8  
➜  ~  cat /etc/locale.conf 
LANG=en_US.UTF-8
➜  ~  localectl 
   System Locale: LANG=en_US.UTF-8
       VC Keymap: n/a
      X11 Layout: n/a
➜  ~  locale -a
C
POSIX
en_US.utf8
➜  ~  locale
LANG=
LC_CTYPE=
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=

I have tried locale-gen and restart too.

Last edited by ciolkovszkij (2014-12-26 19:21:20)

Offline

#2 2014-12-26 13:05:23

colegui
Member
From: Castellón de la Plana, Spain.
Registered: 2014-07-20
Posts: 64

Re: [SOLVED] locale config has no effect

Hi, @ciolkovszkij,

i think first:

Set preferences for location: ( my configuration):

# nano /etc/locale.conf 

LANG=es_ES.UTF-8

After ..

Activate our location:

# nano /etc/locale.gen

es_ES.UTF-8 UTF-8

Generate Location:

# locale-gen 


Regards.

Offline

#3 2014-12-26 14:08:16

clfarron4
Member
From: London, UK
Registered: 2013-06-28
Posts: 2,163
Website

Re: [SOLVED] locale config has no effect

@ciolkovszkij: Pretty much what @colegui says, but I'd be editing the /etc/locale.gen file and then running locale-gen before setting the preferences in /etc/locale.conf.


Claire is fine.
Problems? I have dysgraphia, so clear and concise please.
My public GPG key for package signing
My x86_64 package repository

Offline

#4 2014-12-26 16:25:50

ciolkovszkij
Member
Registered: 2014-12-26
Posts: 5

Re: [SOLVED] locale config has no effect

@colegui and clfarron4: Thank you for your help but I'm afraid it did not do anything.
I tried your advice in both order (and rebooted my machine) however my LANG env var is still empty. (I guess I could set it somewhere else but something utilizing locale.conf would be better)

ygp# cat /etc/locale.gen 
en_US.UTF-8 UTF-8  
ygp# cat /etc/locale.conf
LANG=en_US.UTF-8
ygp# locale-gen
Generating locales...
  en_US.UTF-8... done
Generation complete.
ygp# locale
LANG=    # <--------------- it is still empty
LC_CTYPE=
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=

Offline

#5 2014-12-26 16:58:45

thiagowfx
Member
Registered: 2013-07-09
Posts: 586

Re: [SOLVED] locale config has no effect

Okay, let's try some debugging.

1. Try adding en_US ISO-8859-1 to your /etc/locale.gen file too. Leave both UTF-8 and this one uncommented in this file. After that, run locale-gen as root, then edit your /etc/locale.conf, making it  be like this:

LANG=en_US.UTF-8
LC_ALL=en_US.UTF-8

Finally, reboot your computer, just to make sure those settings will take effect.

2. If the previous item doesn't work, repeat it but this time with another locale. pt_BR, fr_FR, you choose any one.

Your outputs are very complete, thanks for that. But I will ask you to include 'localectl list-locales' too.

Offline

#6 2014-12-26 17:00:08

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

Re: [SOLVED] locale config has no effect

Post the output of

locale -a
localectl

Offline

#7 2014-12-26 17:39:59

ciolkovszkij
Member
Registered: 2014-12-26
Posts: 5

Re: [SOLVED] locale config has no effect

After including en_US ISO-8859-1 in locale.gen:

#  ~  cat /etc/locale.gen
en_US.UTF-8 UTF-8
en_US ISO-8859-1

#  ~  cat /etc/locale.conf
LANG=en_US.UTF-8
LC_ALL=en_US.UTF-8

#  ~  localectl list-locales
en_US
en_US.iso88591
en_US.utf8
#  ~  locale -a
C
POSIX
en_US
en_US.iso88591
en_US.utf8
#  ~  localectl
   System Locale: LANG=en_US.UTF-8
       VC Keymap: n/a
      X11 Layout: n/a
#  ~  locale
LANG=
LC_CTYPE=
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=

Using hu_HU.UTF-8 instead of en_US

#  ~  cat /etc/locale.gen  
hu_HU.UTF-8 UTF-8
#en_US.UTF-8 UTF-8  
#en_US ISO-8859-1

#  ~  cat /etc/locale.conf
LANG=hu_HU.UTF-8
#  ~  locale   
LANG=
LC_CTYPE=
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
hu_HU.utf8
#  ~  localectl 
   System Locale: LANG=hu_HU.UTF-8
       VC Keymap: n/a
      X11 Layout: n/a
#  ~  localectl list-locales
hu_HU.utf8

Using hu_HU.UTF-8 also produced a wierd error msg when I opened uxterm: (It may be unrelated)

uxterm tried unsuccessfully to use locale en_US.UTF-8
by setting $LC_CTYPE to "en_US.UTF-8".

Using only localectl to set the locale seems to have no effect.

After setting LANG to en_US.UTF-8 in locale.conf the locale command gives the results above however the localectl reports LANG=en_US.UTF-8 as the system locale.

If I change the locale manually (e.g. export LANG=en_EN.UTF-8) to en from something else, `localctl` keeps displaying the previous one while `locale` lists the env vars correctly but emits the following warnings:

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

Also there is nothing setting locale configs in XDG_CONFIG_HOME nor in .config nor anywhere I am aware of.

Offline

#8 2014-12-26 18:46:03

ciolkovszkij
Member
Registered: 2014-12-26
Posts: 5

Re: [SOLVED] locale config has no effect

It works if I (arch_)chroot, so I think the problem may be with systemd but I am not sure.

Offline

#9 2014-12-26 19:21:03

ciolkovszkij
Member
Registered: 2014-12-26
Posts: 5

Re: [SOLVED] locale config has no effect

Ok, sorry everyone, It was my mistake.
In /etc/slim.conf I forgot to pass -login to bash, so the scripts in /etc/profile.d were never called.
I'm marking this thread solved. Thank you for your help.

Offline

Board footer

Powered by FluxBB