Operating records for modifying system codes under Linux

Source: Internet
Author: User
Tags i18n locale


Linux system installed, found that Chinese display garbled. Because the system is encoded as en_US. UTF-8, should be changed to support the Chinese encoding (i.e. ZH_CN. UTF-8)
The operation record is as follows:
1) Check the Linux system code
Check the Linux system code to determine if the system supports Chinese. Enter the command in the terminal of the Linux system: locale, you will see the printed system encoding information.
[Email protected] ~]#locale
Lang=en_us. UTF-8
Lc_ctype= "en_US. UTF-8 "
Lc_numeric= "en_US. UTF-8 "
Lc_time= "en_US. UTF-8 "
Lc_collate= "en_US. UTF-8 "
Lc_monetary= "en_US. UTF-8 "
Lc_messages= "en_US. UTF-8 "
Lc_paper= "en_US. UTF-8 "
Lc_name= "en_US. UTF-8 "
Lc_address= "en_US. UTF-8 "
Lc_telephone= "en_US. UTF-8 "
Lc_measurement= "en_US. UTF-8 "
Lc_identification= "en_US. UTF-8 "
Lc_all=

Modify the system encoding so that it supports Chinese
method One:
(2) editing system encoding files
[Email protected] ~]#vim/etc/sysconfig/i18n
lang= "ZH_CN. UTF-8 "
[Email protected] ~]#source/etc/sysconfig/i18n

Check the system code again and find that it has been changed to support Chinese encoding
[Email protected] ~]#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=

Method Two
(3) The declaration of the PATH variable is added to the system's environment variable file, which works for the whole system.
[Email protected] ~]#Vim/etc/profile//Add the following at the bottom of the file
........
lc_all= "ZH_CN. UTF-8 "
export lang= "ZH_CN. UTF-8 "
[Email protected] ~]# Source/etc/profile
[Email protected] ~]# locale


---------------------------------------------------------------------------------------------
found in Windows editing under the Chinese, under Linux display as garbled problem.
This is because the default encoding for Windows is GBK, and the default encoding for Linux is UTF-8.
To resolve this issue, you need to modify the default encoding for Linux to GBK.
[Email protected] ~]# vim/etc/sysconfig/i18n
Lang= "ZH_CN. GBK "
Supported= "ZH_CN. Utf-8:zh_cn:zh "
Sysfont= "Latarcyrheb-sun16"
[Email protected] ~]# source/etc/sysconfig/i18n
[Email protected] ~]# locale

or modify the system environment variables directly
[Email protected] ~]# Vim/etc/profile
......
Export Lc_all= "ZH_CN. GBK "
Export lang= "ZH_CN. GBK "
[Email protected] ~]# Source/etc/profile
[Email protected] ~]# locale

Operating records for modifying system codes under Linux

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.