Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mj1911 opened this issue Aug 10, 2024 · 2 comments

Comments

@mj1911
Copy link

mj1911 commented Aug 10, 2024

Good day,

I realize we can't support every distribution, but wanted to mention an odd warning affecting xxdiff on at least Mabox (possibly Manjaro, Arch Linux.) Mabox can be found here: https://maboxlinux.org It is a rolling-release, so is up-to-date.

When xxdiff v5.1 (Qt 6.7.2) is installed in Mabox via the pamac installer (repo), it seems to run fine but always gives this warning:

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.

Thinking my locales were messed up, checked locale:

me@mine ~ $ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8

Nothing is set to =C so unsure where xxdiff thinks the locales are mis-set. This is the first time I've seen this message on this box, ever.

I've not saved a file with xxdiff yet, because want to use it to compare .conf files with .pacnew and .pacsave backups (and merge changes.) Those files are created from pamac when it detects new conf files (as opposed to just overwriting them.)

Further, a friend tried sudo apt install xxdiff (assuming Debian) and they do not get this message; it runs as expected.

Is there some quirk with locales only in Arch / Manjaro / Mabox? And is this completely benign, or will it save my files in C.UTF-8? Searching, seem to find a few users with similar issues stemming from a newer Qt.

Thanks for the consideration, have a great day.

@blais
Copy link
Owner

blais commented Aug 10, 2024

Thanks mj. I won't have resources to look into this.
This is most like related to this bit:

static char s_env_string_LC_ALL[] = "LC_ALL=C";

//------------------------------------------------------------------------------                                                                                                                                                                                                                                                                                                                                                          
//                                                                                                                                                                                                                                                                                                                                                                                                                                        
int main( int argc, char** argv, char** envp )
{
...
   // Override user locale or xxdiff could not parse localized diff output...                                                                                                                                                                                                                                                                                                                                                             
   putenv(s_env_string_LC_ALL);

I have no idea why I wrote this at the time (it's >20 years ago).
I was probably just being temporarily dumb.
You can try commenting out and testing, see how the problem I alluded manifests.

@WickedSmoke
Copy link

The same warning is reported on my Fedora 40 box as well (also Qt 6.7.2).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants