centos6.5服务器中文乱码/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
centos6.5服务器中文乱码,任何命令都会报错
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
#查看支持的中文
[root@test]# locale -a |grep zh
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_COLLATE to default locale: No such file or directory
zh_CN
zh_CN.gb18030
zh_CN.gb2312
zh_CN.gbk
zh_CN.utf8
zh_HK
zh_HK.big5hkscs
zh_HK.utf8
zh_SG
zh_SG.gb2312
zh_SG.gbk
zh_SG.utf8
zh_TW
zh_TW.big5
zh_TW.euctw
zh_TW.utf8
#/etc/sysconfig/i18n信息,字符集不对造成的
LC_ALL="en_US.UTF-8"
SYSFONT="latarcyrheb-sun16"
改为以下即可:
LANG="zh_CN.UTF-8"
LC_ALL="zh_CN.UTF-8"
验证: