Linux does not show Chinese

Source: Internet
Author: User
Tags i18n

Original: https://www.cnblogs.com/hooly/p/8615384.htmlCopyright: Attribution to the original author!!!

View the character sets that are currently used by default in the system:

# locale

In the Redhat/centos system, the recording system default language file is/etc/sysconfig/i18n, if the default installation is the Chinese system, i18n content is as follows:

lang="zh_cn. UTF-8"  sysfont="latarcyrheb-sun16"  supported="  ZH_CN. Utf-8:zh_cn:zh"

Where lang variable is the abbreviation of language, a slightly English-based user can see that the variable is the default language of the system, that is, the system's menu, the program's toolbar language, input method default language and so on. Sysfont is the abbreviation for system font, which determines which font is used by default. The supported variable determines the language that the system supports, i.e. the language that the system can display. It is necessary to note that since computers originate in English-speaking countries, English is always supported by default, regardless of the font you use, and regardless of the typeface, the text is included.

So how to display Chinese?
1. The system must install the Chinese language pack before it can be

# yum-y Groupinstall Chinese-support

2. Only language packs are not available, we have to set the corresponding character sets

2.1 Temporary entry into force:

# Export lang= "ZH_CN. UTF-8 "    # set to Chinese # export lang=" en_US. UTF-8 "    # set to English

2.2 Permanently effective, edit/etc/sysconfig/i18n (preferably reboot)

Lang= "ZH_CN. UTF-8 "

2.3 Or, edit the/etc/profile configuration file and add the following line

Export lang= "ZH_CN. UTF-8 "
Reload:
# . /etc/profile
To view the current character set:
# echo $LANG

After the above settings, the character set should be set.

View:

Report:

After the character set is set, the Web project download file is garbled and can be changed in Tomcat file.encoding,catalina.sh (Catalina.bat in Windows)-dfile.encoding=utf-8

Of course, you also need to set UTF-8 encoding in Server.xml:

Linux does not show Chinese

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.