How to display Chinese garbled characters in the command line of CentOS terminal

Source: Internet
Author: User
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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.