推荐: blog.csdn.net/aquester https://github.com/eyjian https://www.cnblogs.com/aquester http://blog.chinaunix.net/uid/20682147.html
全部博文(594)
分类: WINDOWS
2016-11-11 17:50:09
示例:
# ls /usr/local//bin/lib /bin/ls: /usr/local/r3c/bin/lib: ????????? |
查看系统字符集设置:
# locale LANG=zh_CN.UTF-8 LC_CTYPE=POSIX LC_NUMERIC="zh_CN.UTF-8" |
查看SecureCRT字符集设置:
问题出在LC_CTYPE,也应当设置为zh_CN.UTF-8:
export LC_CTYPE=zh_CN.UTF-8 |
再次执行,乱码消除:
# ls /usr/local//bin/lib /bin/ls: /usr/local/r3c/bin/lib: 没有那个文件或目录 |
对于vi或vim乱码,则需要在~/.vimrc文件中设置encoding、fileencoding或fileencodings,如:
set encoding=utf8 set fileencoding=utf8 set fileencodings=utf8,gbk |