每当我运行我的代码时:
$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").
我该如何避免?
答案 0 :(得分:4)
UTF-8
不是区域设置名称。将LC_CTYPE
环境变量设置为系统可识别的区域设置。它应该看起来像en_US.UTF-8
。您可以通过运行命令locale -a
获取有效语言环境列表。
答案 1 :(得分:0)
编译区域设置定义列表并重新配置。
locale-gen en_US.UTF-8
dpkg-reconfigure locales