-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Nix does not provide en_US.UTF-8 locale #4829
Comments
The /en_US.UTF-8/LC_CTYPE is just a fallback if the locale isn't in locale-archive. It should be harmless. Is it possible LOCALE_ARCHIVE is not getting set correctly in your nix-shell? This work correctly for me on NixOS:
Does that fail on RHEL7? Adding glibcLocales to your nix-shell will export LOCALE_ARCHIVE for you. |
I just tried setting LOCALE_ARCHIVE again and now it's working... I honestly have no idea what I did differently from yesterday. Thanks for your help. |
It's possible that LOCALE_ARCHIVE could mess up your RHEL7 environment too if it's exported. That is, you probably don't want LOCALE_ARCHIVE set when you run RHEL7 commands. You could try using LOCALE_ARCHIVE_2_27 which I think will just be read by Nixpkgs. |
Was seeing the following error when locale failed: perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = "en_US", LC_ALL = (unset), LANG = "en_US.UTF-8" are supported and installed on your system. perl: warning: Falling back to the standard locale ("C"). ./config/scripts/switch_template.pl syntax OK Fix found: NixOS/nix#4829 (comment)
Was seeing the following error when locale failed: perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = "en_US", LC_ALL = (unset), LANG = "en_US.UTF-8" are supported and installed on your system. perl: warning: Falling back to the standard locale ("C"). ./config/scripts/switch_template.pl syntax OK Fix found: NixOS/nix#4829 (comment)
This issue has been mentioned on NixOS Discourse. There might be relevant details there: |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: |
Describe the bug
There has been some prior discussion of this (see #599), but I thought it best to open a new issue rather than resurrect an old one.
I installed nix on Red Hat 7, but I am having all kinds of difficulties with locales. I have my system locale set to
en_US.UTF-8
, but when I use programs installed by Nix I get errors of this form:I asked about this on IRC and the answer I got was to simply set
LC_ALL
toC.UTF-8
. Unfortunately, RHEL 7 does not support C.UTF-8. So I'm stuck between a rock and a hard place: if I set the locale toC.UTF-8
then Nix packages work, but system packages do not. Conversely, if I useen_US.UTF-8
, system packages work, but Nix packages do not.I have installed
glibc-locales
and tried setting$LOCALE_ARCHIVE
, but that didn't make a difference either. Interestingly, f I install thelocale
package from Nix and runlocale -a
,en_US.UTF-8
is listed. This makes me think that theen_US.UTF-8
locale is included in thelocale-archive
file provided by nix; however, some programs still (apparently?) look for an actualen_US.UTF-8
directory:The problem is that these files don't exist:
I admit that I don't understand locales very well, so I'm not sure what exactly is needed from Nix here. But it would be nice if Nix was able to support the
en_US.UTF-8
locale out of the box.Steps To Reproduce
See above.
Expected behavior
No locale issues.
nix-env --version
outputnix-env (Nix) 2.4pre20210503_6d2553a
The text was updated successfully, but these errors were encountered: