Today in the use of Linux system Chinese language, encountered a problem, is the terminal Input command when the Chinese display garbled. This usually occurs because the Chinese Language pack is not installed, or if there is a problem with the default language set. The workaround is as follows:
View the current system language
After you log on to the Linux system to open the operating terminal, enter echo $LANG to view the currently used system language.
[Root@localhost ~]# Echo $LANG
to view the installed language packs
See if there is a Chinese language pack that can be entered in the terminal locale command, if En cn indicates that the Chinese language has been installed
[root@localhost ~]# locale
lang=zh_cn. UTF-8
lc_ctype= "ZH_CN. UTF-8 "
lc_numeric=" ZH_CN. UTF-8 "
lc_time=" ZH_CN. UTF-8 "
lc_collate=" ZH_CN. UTF-8 "
lc_monetary=" ZH_CN. UTF-8 "
lc_messages=" ZH_CN. UTF-8 "
lc_paper=" ZH_CN. UTF-8 "
lc_name=" ZH_CN. UTF-8 "
lc_address=" ZH_CN. UTF-8 "
lc_telephone=" ZH_CN. UTF-8 "
lc_measurement=" ZH_CN. UTF-8 "
lc_identification=" ZH_CN. UTF-8 "
lc_all=
If you do not have a Chinese language, you can download and install the Chinese Language pack yum groupinstall chinese-support download online. (Can not be networked by other computer downloads, upload up) to modify the system language for Chinese input command lang= "ZH_CN." UTF-8 ", you can change the language to Chinese, as follows:
[Root@localhost ~]# lang= "ZH_CN. UTF-8 "
Other considerations
If you set the above method to set the Chinese language or not, pay attention to the encoding that your link terminal chooses. Take Xshell as an example, the encoding of the terminal to choose Chinese, or UTF8 can be. As follows: