Linux/编码
来自康健生活
< Linux
编码
cat /usr/share/i18n/SUPPORTED
... en_AG UTF-8 en_AU.UTF-8 UTF-8 en_AU ISO-8859-1 en_BW.UTF-8 UTF-8 en_BW ISO-8859-1 en_CA.UTF-8 UTF-8 en_CA ISO-8859-1 en_DK.UTF-8 UTF-8 en_DK.ISO-8859-15 ISO-8859-15 en_DK ISO-8859-1 en_GB.UTF-8 UTF-8 en_GB ISO-8859-1 en_GB.ISO-8859-15 ISO-8859-15 en_HK.UTF-8 UTF-8 en_HK ISO-8859-1 en_IE.UTF-8 UTF-8 en_IE ISO-8859-1 ... yi_US CP1255 yo_NG UTF-8 yue_HK UTF-8 yuw_PG UTF-8 zh_CN.UTF-8 UTF-8 zh_CN.GB18030 GB18030 zh_CN.GBK GBK zh_CN GB2312 zh_HK.UTF-8 UTF-8 zh_HK BIG5-HKSCS zh_SG.UTF-8 UTF-8 zh_SG.GBK GBK zh_SG GB2312 zh_TW.UTF-8 UTF-8 zh_TW.EUC-TW EUC-TW zh_TW BIG5 zu_ZA.UTF-8 UTF-8 zu_ZA ISO-8859-1
ls /var/lib/locales/supported.d
en zh-hans
sudo locale-gen zh_CN.UTF-8
Generating locales (this might take a while)... zh_CN.UTF-8... done Generation complete.
sudo vim /etc/default/locale
LC_ALL="zh_CN.UTF-8"
环境
三个方法: 1. source
source /etc/default/locale
2. export
export LANGUAGE=zh_CN.UTF-8
export LANG=en_USzh_CNUTF-8
export LC_ALL=zh_CN.UTF-8
3. .profile
vim .profile
export LANGUAGE=zh_CN.UTF-8 export LANG=zh_CN.UTF-8 export LC_ALL=zh_CN.UTF-8
source .profile
No categories