You are not logged in.

#1 2023-01-27 09:09:59

LittleSandra
Member
Registered: 2021-01-25
Posts: 86

[SOLVED] UTF8 works as root but not as regular user

Dear all smile

I have just migrated from Fedora to ArchLinux, and UTF8 doesn't show correct as my regular user. But as root, it works fine.

[sandra@t470s tmp]$ touch æøp
[sandra@t470s tmp]$ ls
''$'\303\246\303\270''p'
[sandra@t470s tmp]$ su
Password: 
[root@t470s tmp]# ls
''$'\303\246\303\270''p'
[root@t470s tmp]# 
exit
[sandra@t470s tmp]$ su -
Password: 
[root@t470s ~]# ls /tmp/tmp/
æøp
[root@t470s ~]# 

Notice it is only displayed correct when I "su -".

[sandra@t470s ~]$ 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_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME=en_GB.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=en_GB.UTF-8
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT=en_GB.UTF-8
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
[sandra@t470s ~]$ 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
C.UTF-8
POSIX
en_GB.utf8
[sandra@t470s ~]$ 

I have tried with zsh instead og bash, and the problem is the same. And the problem is also there if I use a TTY instead of X.


Does anyone have an idea what the problem could be?

Hugs,
Sandra smile

Last edited by LittleSandra (2023-01-27 10:27:44)

Offline

#2 2023-01-27 09:15:09

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,257

Re: [SOLVED] UTF8 works as root but not as regular user

Most likely your locale settings are borked: What output do you get from

localctl
locale
locale -a

Offline

#3 2023-01-27 09:22:49

LittleSandra
Member
Registered: 2021-01-25
Posts: 86

Re: [SOLVED] UTF8 works as root but not as regular user

V1del wrote:

Most likely your locale settings are borked: What output do you get from

localctl
locale
locale -a

Just updated OP with the output.

I don't have localctl, and I can't find any package that have this? "pacman -F localctl" doesn't show anything.

Offline

#4 2023-01-27 09:28:41

d.ALT
Member
Registered: 2019-05-10
Posts: 959

Re: [SOLVED] UTF8 works as root but not as regular user

LittleSandra wrote:

I don't have localctl

# localectl

https://man.archlinux.org/man/localectl.1.en

Last edited by d.ALT (2023-01-27 09:29:08)


<49,17,III,I>    Fama di loro il mondo esser non lassa;
<50,17,III,I>    misericordia e giustizia li sdegna:
<51,17,III,I>    non ragioniam di lor, ma guarda e passa.

Offline

#5 2023-01-27 09:31:02

LittleSandra
Member
Registered: 2021-01-25
Posts: 86

Re: [SOLVED] UTF8 works as root but not as regular user

d.ALT wrote:
LittleSandra wrote:

I don't have localctl

# localectl

https://man.archlinux.org/man/localectl.1.en

I see smile

[root@t470s ~]# localectl
System Locale: LANG=en_GB.UTF-8
    VC Keymap: dk
   X11 Layout: dk
    X11 Model: pc105
  X11 Options: terminate:ctrl_alt_bksp

Offline

#6 2023-01-27 09:50:27

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,257

Re: [SOLVED] UTF8 works as root but not as regular user

Whoops sorry for the mistype

You reference en_US locale multiple times but have no locale generated for en_US (... since there are many tools that need this anyway it's always a good idea to have that one regardless) are these references intentional or should everything be en_GB? You will want to generate en_US anyway, but if the en_US references in your locale are not intentional, are you using plasma by chance? See https://wiki.archlinux.org/title/Locale … g_language

Last edited by V1del (2023-01-27 09:50:39)

Offline

#7 2023-01-27 10:04:04

LittleSandra
Member
Registered: 2021-01-25
Posts: 86

Re: [SOLVED] UTF8 works as root but not as regular user

V1del wrote:

Whoops sorry for the mistype

You reference en_US locale multiple times but have no locale generated for en_US (... since there are many tools that need this anyway it's always a good idea to have that one regardless) are these references intentional or should everything be en_GB? You will want to generate en_US anyway, but if the en_US references in your locale are not intentional, are you using plasma by chance? See https://wiki.archlinux.org/title/Locale … g_language

I have now enabled "en_US.UF8" in /etc/locale.gen, and that fixed the issue smile

I would prefer for use "en_GB.UTF8" for everything. Do you know how that is done?

Offline

#8 2023-01-27 11:22:43

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,257

Re: [SOLVED] UTF8 works as root but not as regular user

Read the info in my link, many of the "bigger" DEs have custom ways of changing locale types and you'd have to align them appropriately assuming that is the reason for the difference.

Offline

#9 2023-01-27 12:05:57

LittleSandra
Member
Registered: 2021-01-25
Posts: 86

Re: [SOLVED] UTF8 works as root but not as regular user

V1del wrote:

Read the info in my link, many of the "bigger" DEs have custom ways of changing locale types and you'd have to align them appropriately assuming that is the reason for the difference.

I am not sure I understand what to look for.

My /etc/locale.conf contains only

LANG=en_GB.UTF-8

Should I add the following?

LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC="en_GB.UTF-8"
LC_COLLATE="en_GB.UTF-8"
LC_MONETARY="en_GB.UTF-8"
LC_MESSAGES="en_GB.UTF-8"
LC_NAME="en_GB.UTF-8"
LC_ADDRESS="en_GB.UTF-8"
LC_TELEPHONE="en_GB.UTF-8"
LC_IDENTIFICATION="en_GB.UTF-8"

Offline

#10 2023-01-27 13:03:57

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,257

Re: [SOLVED] UTF8 works as root but not as regular user

That shouldn't be necessary if nothing else is overriding them. Which graphical session are you using? Or do you have potentially some profile/environment files setting different locales e.g. ~/.profile or so

Offline

#11 2023-01-27 13:36:03

LittleSandra
Member
Registered: 2021-01-25
Posts: 86

Re: [SOLVED] UTF8 works as root but not as regular user

V1del wrote:

That shouldn't be necessary if nothing else is overriding them. Which graphical session are you using? Or do you have potentially some profile/environment files setting different locales e.g. ~/.profile or so

I use i3wm. My ~/.profile is empty, and .dmrc

[Desktop]
Session=i3

Offline

#12 2023-01-27 14:24:08

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,393

Re: [SOLVED] UTF8 works as root but not as regular user

grep -r en_US ~/.*

Offline

#13 2023-01-27 18:22:52

LittleSandra
Member
Registered: 2021-01-25
Posts: 86

Re: [SOLVED] UTF8 works as root but not as regular user

seth wrote:
grep -r en_US ~/.*
$ grep -lr en_US ~/.[^.]*|grep -Evi '(cache|google|local|wine|sonar|vscode|libre)'
/home/a/.bashrc

I had overlooked that export smile

Thanks smile

Offline

Board footer

Powered by FluxBB