加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

How can I fix a locale warning from perl?

发布时间:2020-12-15 23:44:41 所属栏目:大数据 来源:网络整理
导读:From: ?http://stackoverflow.com/questions/2499794/how-can-i-fix-a-locale-warning-from-perl When I run? perl ,I get the warning: perl: warning: Setting locale failed.perl: warning: Please check that your locale settings: LANGUAGE = (unset),

From: ?http://stackoverflow.com/questions/2499794/how-can-i-fix-a-locale-warning-from-perl


When I run?perl,I get the warning:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),LC_ALL = (unset),LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

Your OS doesn't know about?en_US.UTF-8.

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

% uname -a
OSF1 hunter2 V5.1 2650 alpha
% perl -e exit
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LC_ALL = (unset),LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

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

AcceptEnv LANG LC_*

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

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

% env LANG=C perl -e exit
%

or with bash:

$ LANG=C perl -e exit
$ 

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.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读