How to solve the problem of Chinese garbled code in Linux system
This article introduces the relevant knowledge of "how to solve the problem of Chinese garbled code in Linux system". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
First, the CentOS system visits g.cn and finds Chinese garbled codes.
So use the previous way: yum-y install fonts-chinese
After the CentOS system is installed, Chinese fonts still cannot be displayed. I use gedit to edit the source code, and its Chinese comments are also garbled.
Later, we finally found the following solution, which requires two Chinese-supported 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 the Chinese font, the other is the font display package.
After downloading, install it on the command line:
# rpm-ivh XXXX (XXXX represents the full name of the above two packages. Rpm doesn't know how to use it, does it? )
After the CentOS system installation is complete, restart it.
Terminal and gedit display garbled code
# vi / etc/sysconfig/i18n
LANG= "en_US.UTF-8"
SYSFONT= "latarcyrheb-sun16"
Modify the original content 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= "lat0-sun16"
Install Chinese fonts with yum
# yum install fonts-chinese.noarch
System-> logout logout
When you log in to the CentOS system again, you will find that all interfaces have changed from English to Chinese. Enter the date command at the terminal to test
# date
Monday, November 24, 2009, 12:07:00 CST
Solution to garbled Chinese display in ssh and telnet terminals (CentOS 5.3)
# vi / etc/sysconfig/i18n
LANG= "en_US.UTF-8" the original content
SYSFONT= "latarcyrheb-sun16"
Modify 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= "lat0-sun16"
Install Chinese fonts with yum
# yum install fonts-chinese.noarch
Disconnect ssh and reconnect
Enter the date command at the terminal to test
# date
Monday, November 24, 2009, 12:09:00 CST
4. Using Chinese input method in CentOS system 5. 3
My previous method was to install the penguin version, see the next page. Here, there is a simpler one, just install SCIM using yum.
Enter on the command line:
# yum install scim
# yum install scim-pinyin
Restart X (press Ctrl+Alt+Backpace) or log out (logout).
This is the end of the content of "how to solve the problem of Chinese garbled code in Linux system". Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!