Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8 (Read 2438 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8

How do I fix?
The fixes I find assume systemd

Re: Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8

Reply #1
A bit of context might help.

Re: Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8

Reply #2
when running octopi update

sudo /usr/lib/octopi/octphelper -ts
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.
If this causes problems, reconfigure your locale. See the locale(1) manual

When running...

lxqt-openssh-askpass
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.
If this causes problems, reconfigure your locale. See the locale(1) manual
for more information.

Is that enough context?


Re: Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8

Reply #4
Check /etc/locale.gen file:
Quote
# Configuration file for locale-gen
#
# lists of locales that are to be generated by the locale-gen command.
#
# Each line is of the form:
#

[...]

#
#  A list of supported locales is given in /usr/share/i18n/SUPPORTED
#  and is included in this file. Uncomment the needed locales below.

Do you know to how uncomment them right?

Re: Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8

Reply #5

RTFM:

https://www.iana.org/assignments/character-sets/character-sets.xhtml
https://dcodesnippet.com/a-utf-8-locale-is-required-got-ansi_x3-4-1968/

Notice:

UTF-8 encodes characters with a variable number of bytes. A Unicode character is encoded in 1 to 4 bytes. The code points 0 to 127, which correspond to the ASCII character set, are encoded in one byte, whereby the most significant bit is always 0. The eighth bit can be used to introduce a longer Unicode character that extends over 2, 3 or 4 bytes. This is the most efficient use of memory space for fonts based on the Latin alphabet.


Apart from that, how about:

Code: [Select]
locale -a
"Wer alles kann, macht nichts richtig"

Artix USE="runit openrc slim openbox lxde gtk2 qt4 qt5 qt6 conky
-gtk3 -gtk4 -adwaita{cursors,themes,icons} -gnome3 -kde -plasma -wayland "

Re: Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8

Reply #6
Check /etc/locale.gen file:
Do you know to how uncomment them right?
/etc/locale.gen:
[...]
[/quote]

in /etc/locale.gen:
en_US.UTF-8 UTF-8
was uncommented  already

A bit of context might help.

RTFM:

https://www.iana.org/assignments/character-sets/character-sets.xhtml
https://dcodesnippet.com/a-utf-8-locale-is-required-got-ansi_x3-4-1968/

Notice:

UTF-8 encodes characters with a variable number of bytes. A Unicode character is encoded in 1 to 4 bytes. The code points 0 to 127, which correspond to the ASCII character set, are encoded in one byte, whereby the most significant bit is always 0. The eighth bit can be used to introduce a longer Unicode character that extends over 2, 3 or 4 bytes. This is the most efficient use of memory space for fonts based on the Latin alphabet.


Apart from that, how about:

Code: [Select]
locale -a
locale -a:
C
C.utf8
POSIX
en_US.utf8

Re: Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8

Reply #7
any thoughts?

Re: Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8

Reply #8
Check your $LANG.
Code: [Select]
echo $LANG

Re: Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8

Reply #9
echo $LANG
en_US.UTF-8

Re: Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8

Reply #10
And the output of
Code: [Select]
locale
?

Re: Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8

Reply #11
locale
LANG=en_US.UTF-8
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEPHONE="C"
LC_MEASUREMENT="C"
LC_IDENTIFICATION="C"
LC_ALL=C


Re: Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8

Reply #13
/etc/locale.conf

LANG=en_US.UTF-8
LC_ADDRESS=en_US.UTF-8
LC_IDENTIFICATION=en_US.UTF-8
LC_MEASUREMENT=en_US.UTF-8
LC_MONETARY=en_US.UTF-8
LC_NAME=en_US.UTF-8
LC_NUMERIC=en_US.UTF-8
LC_PAPER=en_US.UTF-8
LC_TELEPHONE=en_US.UTF-8
LC_TIME=en_US.UTF-8