The Linux character encoding defaults to UTF-8, which can be set to GBK if garbled
1. Manually change the profile command:
VI /etc/profile
You can also modify the/etc/sysconfig/i18n file, such as
lang="en_US. UTF-8"LANG="zh_cn.gb18030 "
There is another way cp/etc/sysconfig/i18n $HOME/.i18n
Modify the $HOME/.i18n file, as
lang="en_US. UTF-8"LANG="zh_cn.gb18030 "
This allows you to change your personal interface language without affecting other users.
The modified/etc/sysconfig/i18n file is:
lang="en_US. UTF-8"supported="zh_cn. GB18030:zh_CN:zh:en_US. Utf-8:en_us:en"sysfont="latarcyrheb-sun16"lc_all ="en_US." UTF-8"export Lc_all
2. Add the following two lines of command at the end of the file:
Export lc_all="zh_cn. GBK"export LANG="zh_cn.gbk "
The configuration that is required is mainly:
en_US. UTF-8 UTF-8
en_US iso-8859-1
ZH_CN GB2312
Zh_cn. GB18030 GB18030
Zh_cn. GBK GBK
Zh_cn. UTF-8 UTF-8
The default is en_US. UTF-8 UTF-8
3. You can also add the following two lines at the end of the/root/.bash_profile file:
Export lc_all="zh_cn. GBK"export LANG="zh_cn.gbk "
Restart the server for the changes to take effect.
4. After successful modification, use the locale command to view, the default setting before modification is:
# Localelang=en_us. utf-8lc_ctype="POSIX"lc_numeric="POSIX"Lc_time="POSIX"lc_collate="POSIX"lc_monetary="POSIX"lc_messages="POSIX"Lc_paper="POSIX"Lc_name="POSIX"lc_address="POSIX"Lc_telephone="POSIX"lc_measurement="POSIX"lc_identification="POSIX"
5. The configuration after successful modification is:
# Localelang=ZH_CN. Gbklc_ctype="ZH_CN.GBKLc_numeric="ZH_CN. GBK"Lc_time="ZH_CN. GBK"lc_collate="ZH_CN.GBKlc_monetary="ZH_CN. GBK"lc_messages="ZH_CN. GBK"Lc_paper="ZH_CN. GBK"Lc_name="ZH_CN. GBK"lc_address="ZH_CN. GBK"Lc_telephone="ZH_CN. GBK"lc_measurement="ZH_CN. GBK"lc_identification="ZH_CN. GBK"Lc_all=zh_cn. GBK
The Linux character encoding defaults to UTF-8, which can be set to GBK if garbled