Mac OS X 上使用 SSH 出现 Perl Warning: Setting Local Failed 的问题


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


这是因为 Mac OS X 使用 SSH 连接远程服务器的时候缺少两个变量,解决办法是在 Mac OS X 本机的 ~/.bash_profle 文件中添加下面两行代码:

export LC_CTYPE=en_US.UTF-8
export LC_ALL=en_US.UTF-8