Problem restoration:
When Xshell accessed and controlled CentOS, it was found that the Chinese characters displayed were garbled, and this problem existed in both the command line and files containing Chinese characters.
Solution:
1. First of all, it is suspected that CentOS has not installed the Chinese dependency package
(recommended tutorial: centos tutorial)
So execute the following instructions to install the dependent packages
yum install fonts-chinese
2. Modify the configuration file /etc/sysconfig/i18n
vim /etc/sysconfig/i18n
Change the original content to:
<pre class="brush:php;toolbar:false"><code>LANG="zh_CN.GB18030" LANGUAGE="zh_CN.GB18030:zh_CN.GB2312:zh_CN" SUPPORTED="zh_CN.UTF-8:zh_CN:zh:en_US.UTF-8:en_US:en" SYSFONT="lat0-sun16"</code>
After rebooting, you will find Still didn't solve the problem.
3. Modify the encoding format of xshell to utf-8
and then establish the connection again. At this time, it is found that it can be displayed normally.
Note: The above two are indispensable. If you are not using xshell, then the third step is redundant.
Recommended related video tutorials: linux video tutorial
The above is the detailed content of What to do if Chinese garbled characters appear in centos6.4 system. For more information, please follow other related articles on the PHP Chinese website!