Linux Terminal Chinese display garbled __linux

Source: Internet
Author: User
Tags locale pack

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:







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.