The centos graphic interface and terminal Chinese garbled characters

Source: Internet
Author: User

Solution to Chinese Garbled text on the centos graphic interface

Recently, when xen and virt-manager are used in the graphic interface, half of the interface's Chinese characters are garbled and half of the Chinese characters are normal. I guess most of them are caused by Lang. However, the problem cannot be solved after modification. At last, lc_all was not changed.

[Root @ glnode04 ~] # Vim ~ /. Bashrc
# Export lang = zh_cn.gb18030 cancel, comment out, do not use gb18030
Export lang = zh_CN.UTF-8 uses UTF-8 Encoding

[Root @ glnode04 ~] # Vim/etc/sysconfig/i18n
Lang = "en_US.UTF-8" Default
Supported = "en_US.UTF-8: en_us: en"
Sysfont = "latarcyrheb-sun16"
# Export lc_all = "zh_cn.gb18030" cancel, comment out

 

Run the Cal command to test it. It is normal.

 

[Root @ glnode04 ~] # Cal
November 11, April 20
October 6, 1234
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30

 

In addition, when the encoding in xshell is the same as the file encoding, Chinese characters are not garbled; otherwise, Chinese characters are garbled.

In xshell, the button like Earth is the encoding button, which can modify the xshell encoding.

It is recommended to use a unified zh_CN.UTF-8 encoding, Windows can also be directly identified

Bytes -------------------------------------------------------------------------------------------------------------------------

Solution to Chinese Garbled text on the centos graphic interface

If the Chinese character pack is not installed, Chinese characters are garbled. Here we will introduce the solution.

System: centos 5.5

The system settings are as follows:

[Root @ gd37 ~] # Echo $ Lang
Zh_CN.utf-8

[Root @ gd37 ~] # Cat/etc/sysconfig/i18n
Lang = "en_US.UTF-8"
Sysfont = "latarcyrheb-sun16"

Note:
/Etc/sysconfig/i18n the region language settings of the system are stored here, And i18n is short for "Internationalization". The source is the first and last characters of the English word internationalization, I and N, 18 indicates the number of characters in the middle.
The first line indicates the language environment variable settings of your current system
The second line defines the console terminal font, the font displayed when you log on to text is the latarcyrheb-sun16

Garbled:


Solution:
This is because no Chinese package is installed, the installation of fonts-chinese-3.02-12.el5.rpm Chinese Character package can solve the problem

[Root @ gd37 ~] # Yum install fonts-Chinese

Refer:
Http://woshileilei.blog.sohu.com/71350704.html
Http://hi.baidu.com/du_liang/blog/item/aa571c61a77fe3d38cb10d2f.html

 

 

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.