Today, xshell is used to connect to centos6.5, when the terminal code is set to: Unicode (UTF-8), the output of the command to execute service iptables restart will be garbled; when the encoding is set to: default language, ls output will be garbled!
Garbled issues such:
The output result of executing the locale command is as follows:
LANG=zh_CN.GB18030LC_CTYPE="zh_CN.GB18030"LC_NUMERIC="zh_CN.GB18030"LC_TIME="zh_CN.GB18030"LC_COLLATE="zh_CN.GB18030"LC_MONETARY="zh_CN.GB18030"LC_MESSAGES="zh_CN.GB18030"LC_PAPER="zh_CN.GB18030"LC_NAME="zh_CN.GB18030"LC_ADDRESS="zh_CN.GB18030"LC_TELEPHONE="zh_CN.GB18030"LC_MEASUREMENT="zh_CN.GB18030"LC_IDENTIFICATION="zh_CN.GB18030"LC_ALL=
Then find the corresponding encoding in xshell, and the result does not match. Try several similar results:
Since the language codes at both ends are inconsistent and the corresponding Code cannot be found in xshell, modify the system!
Run the command: VI/etc/sysconfig/i18n
Is modified, before modification:
# Lang = "zh_CN.UTF-8"
Lang = "zh_cn.gb18030"
After the modification, save and set the encoding to Unicode (UTF-8), run the command to test the output, OK, garbled problem solved.