This article mainly introduces how to display Chinese garbled characters in the command line of the CentOS terminal, as well as the test method and the solution when the Chinese font is missing. if you need it, refer to the following tag: CentOS
When CentOS is installed, select Chinese, and the result cannot be displayed on the terminal. it Is Garbled. solution:
Modify/etc/sysconfig/i18n with the following content:
Copy codeThe code is as follows:
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"
Log out and log on again.
Test method:Enter the date command on the terminal for testing. if it is displayed in the following format, it means that the solution is successfully solved.
Copy codeThe code is as follows: # date
Monday, November 24, 2009 12:09:00 CST
If there is no Chinese font in the system, Please install the Chinese font:
Copy codeThe code is as follows:
# Yum install fonts-chinese.noarch
If the font file cannot be found, you can use the rpm Package for installation.
Two packages supported by Chinese characters are required:
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 a Chinese font and the other is a font display package.
After the download, install it on the command line:
Copy codeThe code is as follows: # rpm-ivh XXXX (XXXX represents the full name of the two packages above. why not use rpm ?)
After the CentOS system is installed, restart it.