Linux Chinese display settings
1.1 Viewing the currently used character set
1.1.1 Viewing the current character set (language) used by the system
Lang
Echo $LANG
en_US. UTF-8
1.1.2 Modifying the system's character set (language)
Lang=zh_cn. UTF-8
LANG PS1 Linux environment variable (can be used in any corner of Linux)
Export LANG=ZH_CN. UTF-8
1.1.3 When modifying environment variables, add export before
Echo $LANG
Zh_cn. UTF-8
1.1.4 viewing the current character set (language) used by the system
#LANG
Echo $LANG
en_US. UTF-8
1.2 Temporary modification of the system's character set (language)
Lang=zh_cn. UTF-8
LANG PS1 Linux environment variable (can be used in any corner of Linux)
Export. UTF-8
#修改环境变量的时候前面加上 Export
Echo $LANG
Zh_cn. UTF-8
1.3 Permanently modify the system's character set
cat/etc/sysconfig/i18n
Lang= "en_US. UTF-8 "
Sysfont= "Latarcyrheb-sun16"
Cp/etc/sysconfig/i18n/etc/sysconfig/i18n.bak
Sed-i ' S#en_us#zh_cn#g '/etc/sysconfig/i18n
cat/etc/sysconfig/i18n
Lang= "ZH_CN. UTF-8 "
Sysfont= "Latarcyrheb-sun16"
1.3.1 Effective
Source/etc/profile
Echo $LANG
Zh_cn. UTF-8
1.4 Linux inside Display garbled
Linux inside Display Chinese garbled
A Linux system uses a character set that differs from the Xshell software's character set.
Echo $LANG
1. Troubleshooting
1) Check the character set of the Linux system
Echo $LANG
2) View the character set used by Xshell
2. Resolve
Modifying the system's character set
First milestone-View the character set currently used by the system
#LANG
Echo $LANG
en_US. UTF-8
Second milestone-temporarily modify the system's character set
Lang=zh_cn. UTF-8
# # #LANG PS1 Linux environment variable (can be used in any corner of Linux)
Export LANG=ZH_CN. UTF-8
Add export before modifying environment variables
Echo $LANG
Zh_cn. UTF-8
Third milestone-permanently modify the system's character set
cat/etc/sysconfig/i18n
Lang= "en_US. UTF-8 "
Sysfont= "Latarcyrheb-sun16"
Cp/etc/sysconfig/i18n/etc/sysconfig/i18n.bak
Sed-i ' S#en_us#zh_cn#g '/etc/sysconfig/i18n
cat/etc/sysconfig/i18n
Lang= "ZH_CN. UTF-8 "
Sysfont= "Latarcyrheb-sun16"
3. Entry into force
Source/etc/profile
Echo $LANG
Zh_cn. UTF-8
This article is from the "Heyong" blog, make sure to keep this source http://heyong.blog.51cto.com/13121269/1954903
Linux Chinese display settings