How to solve Chinese garbled characters in centos6.5 system

王林
Release: 2020-03-26 10:49:26
Original
3008 people have browsed it

How to solve Chinese garbled characters in centos6.5 system

Problem restoration:

The system displays Chinese garbled characters, as shown in the picture:

How to solve Chinese garbled characters in centos6.5 system

Analysis:

The default encoding for Windows is GBK, and the default encoding for Linux is UTF-8. Chinese edited under Windows is displayed as garbled characters under Linux. In order to solve this problem, modify the default encoding of Linux to GBK.

(Recommended tutorial: centos tutorial)

Solution:

1. Install the English version. The default character set configuration is:

# cat /etc/sysconfig/i18n
LANG="en_US.UTF-8"
SYSFONT="latarcyrheb-sun16
Copy after login

2. Change to Chinese character set:

# vi /etc/sysconfig/i18n
LANG="zh_CN.GBK"
SUPPORTED="zh_CN.UTF-8:zh_CN:zh"
SYSFONT="latarcyrheb-sun16"
Copy after login

3. Execute the following command or restart the system to take effect.

# source /etc/sysconfig/i18n
Copy after login

Recommended related video tutorials: linux video tutorial

The above is the detailed content of How to solve Chinese garbled characters in centos6.5 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