欢迎光临
我们一直在努力

How to fix a locale setting warning from Perl?

https://stackoverflow.com/questions/2499794/how-to-fix-a-locale-setting-warning-from-perl

When I run perl, I get the warning:

How do I fix it?

Your OS doesn’t know about en_US.UTF-8.

You didn’t mention a specific platform, but I can reproduce your problem:

My guess is you used ssh to connect to this older host from a newer desktop machine. It’s common for /etc/ssh/sshd_config to contain

which allows clients to propagate the values of those environment variables into new sessions.

The warning gives you a hint about how to squelch it if you don’t require the full-up locale:

or with bash:

For a permanent fix, choose one of

  1. On the older host, set the LANG environment variable in your shell’s initialization file.
  2. Modify your environment on the client side, e.g., rather than ssh hunter2, use the command LANG=C ssh hunter2.
  3. If you have admin rights, stop ssh from sending the environment variables by commenting out the SendEnv LANG LC_* line in the local /etc/ssh/ssh_config file. (Thanks to this answer. See Bug 1285 for OpenSSH for more.)
赞(0)
未经允许不得转载:小明编程 » How to fix a locale setting warning from Perl?

评论 抢沙发