1

每当我运行我的代码时:

$perl my_any_code.pl 

它总是给我这个:

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

我怎样才能避免这种情况?

4

2 回答 2

4

UTF-8不是语言环境名称。将LC_CTYPE环境变量设置为系统可识别的语言环境。它应该看起来像en_US.UTF-8. 您可以通过运行命令获取有效语言环境的列表locale -a

于 2012-04-21T07:04:16.173 回答
0

编译您的语言环境定义列表并重新配置它。

locale-gen en_US.UTF-8
dpkg-reconfigure locales
于 2013-07-02T09:03:32.340 回答