最近使用 macOS zsh ssh 登录远程服务器时候,终端会出现如下提示内容:
-bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
显示中文字符时会不规则的乱码,有些字符乱,有些字符不乱
解决办法是编辑 ~/.zshrc 文件,手动设置一下终端环境的语言编码:
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8