You are not logged in.

#1 2025-12-24 19:16:56

Tenry
Member
Registered: 2025-12-24
Posts: 3

[SOLVED] locale issue (missing UTF-8 support in nano, git, etc.)

Hi! I have issues with UTF-8 characters in CLI programs. Some programs also print a warning in the console upon startup regarding the locale setting.

I hope someone has an idea where my issue may be coming from or have some suggestions what else I could check.

What do I observe?

Many CLI programs do not support UTF-8 characters (unless I set `LC_ALL` explicitly). In `nano`, UTF-8 characters (upon input as well as existing text) is shown as "random" other multi-char items. `git diff` shows some hex codes in place of UTF-8 characters. Certain programs print warnings about the locale, such as:

Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8.
Qt depends on a UTF-8 locale, and has switched to "C.UTF-8" instead.

I do not observe any encoding issues in GUI programs. Some CLI programs, such as `cat`, display unicode characters just fine.

What is my setup?

I use Arch Linux with KDE Plasma for the desktop. The output of locale is:

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=de_CH.UTF-8
LC_TIME=en_DE.UTF-8
LC_COLLATE=C.UTF-8
LC_MONETARY=de_DE.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=de_DE.UTF-8
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT=de_DE.UTF-8
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

The output of locale -a is:

C
C.utf8
POSIX
de_CH.utf8
de_DE.utf8
en_US.utf8

/etc/locale.conf contains:

LANG=en_US.UTF-8
LC_COLLATE=C.UTF-8

The output of localectl status is:

System Locale: LANG=en_US.UTF-8
               LC_COLLATE=C.UTF-8
    VC Keymap: us
   X11 Layout: (unset)

The contents of ~/.config/plasma-localerc is:

[Formats]
LANG=en_US.UTF-8
LC_MEASUREMENT=de_DE.UTF-8
LC_MONETARY=de_DE.UTF-8
LC_NUMERIC=de_CH.UTF-8
LC_PAPER=de_DE.UTF-8
LC_TIME=en_DE.UTF-8

echo "$LANG" gives me en_US.UTF-8.

I consulted all kind of documentation (including the wiki) and also asked AI for clues. I did do locale-gen after editing /etc/locale.gen during initial setup (a few months ago) and also tried this multiple times in the meantime whenever I was investigating the issue again. Computer restarts included.

Last edited by Tenry (2025-12-24 21:39:22)

Offline

#2 2025-12-24 20:05:39

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,351

Re: [SOLVED] locale issue (missing UTF-8 support in nano, git, etc.)

Saw title and said to myself, "I bet it's Plasma". This is a long-standing issue. https://wiki.archlinux.org/title/KDE#Pl … e_settings

Offline

#3 2025-12-24 20:13:28

Tenry
Member
Registered: 2025-12-24
Posts: 3

Re: [SOLVED] locale issue (missing UTF-8 support in nano, git, etc.)

Scimmia wrote:

Saw title and said to myself, "I bet it's Plasma". This is a long-standing issue. https://wiki.archlinux.org/title/KDE#Pl … e_settings

It might indeed be Plasma, even though the contents of the Plasma file looks alright to me yikes actually, when switching to a virtual console (Ctrl + Alt + F3, for example), nano handles unicode just fine.

I'll try following the mentioned section the next time I restart my computer and let you know when it's solved.

Offline

#4 2025-12-24 21:38:05

Tenry
Member
Registered: 2025-12-24
Posts: 3

Re: [SOLVED] locale issue (missing UTF-8 support in nano, git, etc.)

Removed ~/.config/plasma-localerc, computer restarted, problem solved. Thanks!

EDIT: Removing that file did also reset all my individual locale settings (e.g. 24h clock, specific format for numbers).

Last edited by Tenry (2025-12-25 00:49:22)

Offline

Board footer

Powered by FluxBB