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