当我运行perl时,我得到警告:
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").
我该怎么解决呢?
以下是如何在Mac OS X v10.7 (Lion)或Cygwin (Windows 10)上解决这个问题:
在主机上的bashrc或bash_profile文件中添加以下代码行:
# Setting for the new UTF-8 terminal support in Lion
export LC_CTYPE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
如果你使用Z shell (zsh),编辑文件zshrc:
# Setting for the new UTF-8 terminal support in Lion
LC_CTYPE=en_US.UTF-8
LC_ALL=en_US.UTF-8