CentOS 7默认编码方式为UTF-8
#查看系统现支持编码
[hadoop@www ]#locale
LANG=en_US.UTF-8 #或zh_CN.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL="en_US.UTF-8"
#查看系统是否已安装中文语言包
[hadoop@www ]# locale -a|grep zh
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
#永久支持中文修改
[hadoop@www ]# vim /etc/locale.conf
LANG="zh_CN.UTF-8"
LC_ALL="zh_CN.UTF-8"
LC_CTYPE="zh_CN.UTF-8"
[hadoop@www ]# vim /etc/locale.conf
LANG="zh_CN.GBK" #GBK编码后,系统的Terminal终端可能会出现中文乱码,修改reboot重启后可以打开Terminal,输入ll命令查看,如果“总用量”处显示为乱码,建议还是修改回UTF-8编码形式
LC_ALL="zh_CN.GBK"
LC_CTYPE="zh_CN.GBK"