Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem that linux does not support Chinese?

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

What if linux does not support Chinese?

View the character set used by the current system by default:

# locale

Under the RedHat/CentOS system, the file that records the language used by the system by default is / etc/sysconfig/i18n. If the Chinese system is installed by default, the content of i18n is as follows:

LANG= "zh_CN.UTF-8" SYSFONT= "latarcyrheb-sun16" SUPPORTED= "zh_CN.UTF-8:zh_CN:zh"

LANG variable is the abbreviation of language. Users with a little English foundation can see that this variable determines the default language of the system, that is, the menu of the system, the toolbar language of the program, the default language of input method, and so on. SYSFONT is short for system font, which determines which font the system uses by default. The SUPPORTED variable determines the language that the system supports, that is, the language that the system can display. It is important to note that since computers originated in English-speaking countries, English is always supported by default no matter what you set these variables to, and English fonts are always included no matter what font you use.

So how to display Chinese?

1. The Chinese language pack must be installed on the system

# yum-y groupinstall chinese-support

two。 It's not just a language pack, we have to set the corresponding character set.

2.1 temporary effect:

# export LANG= "zh_CN.UTF-8" # set to Chinese # export LANG= "en_US.UTF-8" # set to English

2.2 permanent, edit / etc/sysconfig/i18n (preferably reboot)

LANG= "zh_CN.UTF-8"

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

Export LANG= "zh_CN.UTF-8"

Reload:

#. / etc/profile

View the current character set:

# echo $LANG

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

View:

Attached:

After the character set is set, the garbled code in the download file of the web project 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:

These are the details of what to do if linux does not support Chinese. Please pay more attention to other related articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report