You are not logged in.

#1 2020-09-27 19:25:16

vdl
Member
Registered: 2015-06-18
Posts: 5

[SOLVED] Locale trouble despite locales being properly generated

I have locale problems despite being pretty certain that my locales have been properly generated.

Symptoms are: terminal not displaying wide characters properly, man complaining about not being able to set the locale, certain applications refusing to work altogether.

Here is how I checked to make sure the locales are correctly set up.

Preferred language is en_CA:

[root@giono ~]# cat /etc/locale.conf
LANG=en_CA.UFT-8

Generated locales are en_CA, en_US and fr_CA, all using UTF-8:

[root@giono ~]# grep en_CA /etc/locale.gen
en_CA.UTF-8 UTF-8  
#en_CA ISO-8859-1  
[root@giono ~]# grep en_US /etc/locale.gen
#  en_US ISO-8859-1
#  en_US.UTF-8 UTF-8
en_US.UTF-8 UTF-8  
#en_US ISO-8859-1  
[root@giono ~]# grep fr_CA /etc/locale.gen
fr_CA.UTF-8 UTF-8  
#fr_CA ISO-8859-1  

Locales were correctly generated:

[root@giono ~]# locale-gen
Generating locales...
  en_CA.UTF-8... done
  en_US.UTF-8... done
  fr_CA.UTF-8... done
Generation complete.

There is a weird error message in the output of the locale command—from my googling, it usually indicates locales not being properly generated:

[root@giono ~]# locale -a
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_COLLATE to default locale: No such file or directory
C
POSIX
en_CA.utf8
en_US.utf8
fr_CA.utf8
[root@giono ~]# 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=en_CA.UFT-8
LC_CTYPE="en_CA.UFT-8"
LC_NUMERIC="en_CA.UFT-8"
LC_TIME="en_CA.UFT-8"
LC_COLLATE="en_CA.UFT-8"
LC_MONETARY="en_CA.UFT-8"
LC_MESSAGES="en_CA.UFT-8"
LC_PAPER="en_CA.UFT-8"
LC_NAME="en_CA.UFT-8"
LC_ADDRESS="en_CA.UFT-8"
LC_TELEPHONE="en_CA.UFT-8"
LC_MEASUREMENT="en_CA.UFT-8"
LC_IDENTIFICATION="en_CA.UFT-8"
LC_ALL=

Terminal is not displaying wide characters (the second line is what I see but I could not copy and paste it):

python -c "print(\"\xE2\x98\xA0\")"
6 x U+FFFD replacement character

man is having trouble:

[root@giono ~]# man test
man: can't set the locale; make sure $LC_* and $LANG are correct

So are certain other applications (application fails to start despite what it says):

[vdl@giono ~]$ anydesk
No UTF-8. Trying to change locale.
C.UTF-8: not available.
Locale sucessfully changed.

Last edited by vdl (2020-09-28 00:03:56)

Offline

#2 2020-09-27 20:40:53

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 10,831

Re: [SOLVED] Locale trouble despite locales being properly generated

Read what your locale variables are set to. UFT != UTF

Offline

#3 2020-09-27 20:47:31

vdl
Member
Registered: 2015-06-18
Posts: 5

Re: [SOLVED] Locale trouble despite locales being properly generated

Wow, great catch! I have been trying to figure this out for months. Thank you!

Offline

#4 2020-09-27 21:02:14

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 10,831

Re: [SOLVED] Locale trouble despite locales being properly generated

Glad to hear, please mark as [SOLVED] by editing the title in your first post.

Offline

Board footer

Powered by FluxBB