Artix Linux Forum

Artix Linux => Installation / Migration / Configuration => Topic started by: n00b on 04 July 2024, 15:54:54

Title: Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8
Post by: n00b on 04 July 2024, 15:54:54
How do I fix?
The fixes I find assume systemd
Title: Re: Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8
Post by: gripped on 04 July 2024, 16:39:09
A bit of context might help.
Title: Re: Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8
Post by: n00b on 04 July 2024, 16:45:08
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?
Title: Re: Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8
Post by: gripped on 04 July 2024, 18:50:45
N
Title: Re: Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8
Post by: kiblaster on 04 July 2024, 20:08:34
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?
Title: Re: Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8
Post by: lq on 05 July 2024, 16:25:41

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
Title: Re: Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8
Post by: n00b on 10 July 2024, 17:58:16
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
Title: Re: Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8
Post by: n00b on 22 July 2024, 18:39:22
any thoughts?
Title: Re: Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8
Post by: Ambie on 22 July 2024, 20:02:16
Check your $LANG.
Code: [Select]
echo $LANG
Title: Re: Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8
Post by: n00b on 23 July 2024, 22:31:19
echo $LANG
en_US.UTF-8
Title: Re: Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8
Post by: Ambie on 24 July 2024, 09:26:05
And the output of
Code: [Select]
locale
?
Title: Re: Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8
Post by: n00b on 24 July 2024, 22:07:43
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
Title: Re: Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8
Post by: Ambie on 25 July 2024, 10:07:27
I guess that's the problem. Check your /etc/locale.conf.
https://wiki.archlinux.org/title/Locale#Variables
Title: Re: Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8
Post by: n00b on 25 July 2024, 17:47:43
/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
Title: Re: Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8
Post by: Ambie on 25 July 2024, 18:07:11
Something is redefining these variables. You should find out what. Check your startup scripts, services, shell init files and so on.
https://wiki.archlinux.org/title/Environment_variables#Defining_variables
Title: Re: Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8
Post by: TheExplorer on 29 July 2024, 14:31:17
Anything suspicious in your /etc/profile.d ? Like customlocale.sh, for example.
Title: Re: Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8
Post by: TheExplorer on 29 July 2024, 14:39:04
Btw, what is that octphelper command? Cannot find any manual. What does it do and why should it be started separately from octopi?
Title: Re: Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8
Post by: n00b on 05 August 2024, 00:09:40
Anything suspicious in your /etc/profile.d ? Like customlocale.sh, for example.
no?

/etc/profile.d$ ls
conda.sh        debuginfod.sh      flatpak.csh  freetype2.sh  gawk.sh   gmsh.sh  jre.csh  libreoffice-still.csh  locale.sh       openfoam-8.sh  perlbin.sh
debuginfod.csh  flatpak-bindir.sh  flatpak.sh   gawk.csh      gmsh.csh  gpm.sh   jre.sh   libreoffice-still.sh   opencascade.sh  perlbin.csh

Can you give me a hint on what is suspicious?
Btw, what is that octphelper command? Cannot find any manual. What does it do and why should it be started separately from octopi?
in octopi you can choose terminal update, and that command is executed in the terminal
Title: Re: Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8
Post by: n00b on 05 August 2024, 00:14:29
in ~/.bashrc

I found

[ -f /opt/miniconda3/etc/profile.d/conda.sh ] && source /opt/miniconda3/etc/profile.d/conda.sh
export LC_ALL=C

Is this the issue?
Title: Re: Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8
Post by: tintin on 05 August 2024, 08:08:50
in ~/.bashrc

I found

[ -f /opt/miniconda3/etc/profile.d/conda.sh ] && source /opt/miniconda3/etc/profile.d/conda.sh
export LC_ALL=C

Is this the issue?
I don't know if this is good, but below is my .bashrc
Spoiler (click to show/hide)
Title: Re: Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8
Post by: Ambie on 05 August 2024, 10:39:07
Most probably yes. Try to comment it out.
Title: Re: Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8
Post by: n00b on 06 August 2024, 03:16:32
It seemed to have worked,

Thanks all