This is a problem that worries domestic Linux users. Since most Linux distributions are mainly in English, and English is better than Chinese in terms of versatility and stability, and there are fewer strange BUGs. Therefore, it is strongly recommended to use the English system.
We know that our operating system does not matter the Chinese version or the English version. Whether it is Windows or Linux, when the system is released, the whole world has the same kernel. Whether the system is presented to us in English or Chinese depends entirely on what you choose. Language pack. People from different countries choose the language pack of their own country when installing and using it. The language in the application is not hard-coded. It calls the relevant language according to the system settings. Therefore, an application is written without modification. Users from different countries around the world can use it in their native language interface. This is the so-called internationalization, or i18n for short. This is also the development trend of future software.
So, if I install different language packs and different fonts in the system, how does the system determine the language interface I want and call the relevant fonts? What files and variables in the system control this?
You can use the locale command to view the default character set used by the current system
#locale
Under the RedHat/CentOS system, the file recording the default language used by the system is /etc/sysconfig/i18n. If the default installation is a Chinese system , the content of i18n is as follows:
LANG="zh_CN.UTF-8"
SYSFONT="latarcyrheb-sun16"
SUPPORTED="zh_CN.UTF-8:zh_CN:zh"
where the LANG variable is the abbreviation of language, slightly Users with a basic knowledge of English can tell at a glance that this variable determines the default language of the system, that is, the system menu, the toolbar language of the program, the default language of the input method, etc. SYSFONT is the abbreviation of system font, which determines which font the system uses by default. The SUPPORTED variable determines the languages supported by the system, that is, the languages the system can display. It should be noted that since computers originated in English-speaking countries, no matter what you set these variables to, English is always supported by default, and no matter what font is used, English fonts are always included.
So how to display Chinese?
1. The system must install the Chinese language pack
# yum -y groupinstall chinese-support
2. Just having the language pack is not enough, we have to set the corresponding character set
## Temporarily effective
# export LANG=" zh_CN.UTF-8" # Set to Chinese
# export LANG="en_US.UTF-8" # Set to English, I prefer this export
## To take effect permanently, edit /etc/sysconfig/i18n (reboot is best) (() /profile
## Check the current character set
# echo $LANG
Okay, after the above settings, Chinese should be able to be displayed on the terminal.
3. The ssh remote terminal is garbled. If the SSH terminal is still garbled, then we also need to set the encoding of the terminal software.
Xshell:
SecureCRT:
4. What should I do if the terminal is still garbled with Chinese characters?
Set up the SSH software and select a font that supports Chinese.
Linux Windows need to modify files between each other, and then the files will be garbled.
Ubuntu 14.10 installs SecureCRT 7.3 http://www.linuxidc.com/Linux/2014-10/108709.htm
For more articles related to Linux terminal Chinese displaying garbled characters, please pay attention to the PHP Chinese website!