Home  >  Article  >  Operation and Maintenance  >  CentOS command line Chinese garbled solution

CentOS command line Chinese garbled solution

尚
Original
2020-04-01 15:05:022387browse

CentOS command line Chinese garbled solution

1. Download the following two installation packages

fonts-chinese-3.02-12.el5.noarch.rpm
ftp://ftp.muug. mb.ca/mirror/centos/5.4/os/x86_64/CentOS/fonts-chinese-3.02-12.el5.noarch.rpm

fonts-ISO8859-2-75dpi-1.0-17.1.noarch.rpm
ftp://ftp.muug.mb.ca/mirror/centos/5.4/os/x86_64/CentOS/fonts-ISO8859-2-75dpi-1.0-17.1.noarch.rpm
One is Chinese font, One is the font display package.

After downloading, install on the command line:

#rpm -ivh XXXX (XXXX represents the full names of the two packages above. My usage for installing multiple packages is to write it twice. Actually It is possible to test. Some people on the Internet said that followed by multiple package names or rpm -ivh /directory/*.rpm seems to be unusable. You can try it yourself and it will not affect the installation)

After the CentOS system is installed, Just restart.

2. Chinese garbled code solution

Use vi /etc/sysconfig/i18n command to open the configuration file

Modify the original content

LANG="en_US.UTF-8"
SYSFONT="latarcyrheb-sun16"

to

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="lato-sun16"

Enter the date command test in the terminal:

CentOS command line Chinese garbled solution

Recommended tutorial: centos tutorial

The above is the detailed content of CentOS command line Chinese garbled solution. 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