View and repair of the Linux character set

Source: Internet
Author: User
Tags i18n

• View Character Set
The character set is represented in the system as an environment variable, and in CentOS6.5 as an example, it can be viewed in the following ways for the current terminal to use the character set:

The first type:

[Email protected] tmp]# echo $LANGzh _cn. UTF-8

The second type:

[Email protected] ~]# env |grep LANG LANG=ZH_CN. UTF-8

The third type:

[Email protected] ~]# export |grep LANG declare-x lang= "ZH_CN. UTF-8 "

The fourth type:

[Email protected] ~]# locale LANG=ZH_CN. Utf-8lc_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=

Second, the way to modify the character set
Note: If the default language is en_US. UTF-8, it is not possible to display and input Chinese in the Linux character and graphical interface. If the default language is Chinese, such as ZH_CN. GB18030 or zh_cn.gb2312, the character interface cannot be displayed and entered, the graphical interface can be.

There are two ways to modify this:

1, directly set the variable way to modify

Export LANG=ZH_CN. UTF-8

2, modify the file mode, by modifying the/etc/sysconfig/i18n file control

[Email protected] ~]# vim/etc/sysconfig/i18nlang= "ZH_CN. UTF-8 "[[email protected] ~]# source/etc/sysconfig/i18n

  

 

View and repair of the Linux character set

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.