Home >Operation and Maintenance >CentOS >Chinese characters display garbled characters under centos system

Chinese characters display garbled characters under centos system

王林
王林Original
2020-03-19 15:37:592040browse

Chinese characters display garbled characters under centos system

First, install the Chinese language pack:

yum groupinstall chinese-support

Then modify the character encoding configuration. If there is no such file, create it:

vim /etc/sysconfig/i18n

(Recommended tutorial: centos usage tutorial)

The modified content is as follows:

LANG=”zh_CN.GB18030″
SUPPORTED=”zh_CN.UTF-8:zh_CN:zh:en_US.UTF-8:en_US:en”
SYSFONT=”latarcyrheb-sun16″

i18n file is used to set the system language, such as: zh_CN.UTF-8, zh_CN.GB18030, zh_TW .Big5, en_US.UTF-8, etc.

There are three environment variables in i18n:
LANG variable, which sets the system language.
SUPPORTED variable determines the language supported by the system, that is, the language that the system can display.
SYSFONT variable represents the system font.

Finally restart the server:

reboot

Recommended related video tutorials: linux video tutorial

The above is the detailed content of Chinese characters display garbled characters under centos system. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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