运行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 Lion (10.7) 和 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
如果是使用的zsh, 则编辑 zshrc:
# Setting for the new UTF-8 terminal support in Lion LC_CTYPE=en_US.UTF-8 LC_ALL=en_US.UTF-8
————————————ubuntu 系统——————————————–
在ubuntu中如果使用了 debootstrap 工具创建文件系统,请执行下面的命令:
sudo locale-gen en_US.UTF-8
执行失败则