What to do if Chinese garbled characters appear in centos6.4 system

王林
Release: 2020-03-26 10:37:31
Original
2211 people have browsed it

What to do if Chinese garbled characters appear in centos6.4 system

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
Copy after login

2. Modify the configuration file /etc/sysconfig/i18n

vim /etc/sysconfig/i18n
Copy after login

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>
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template