查看中文编码;
[email protected]:~# cat /etc/default/locale LANG="zh_CN.UTF-8" LANGUAGE="zh_CN:zh" LC_NUMERIC="zh_CN" LC_TIME="zh_CN" LC_MONETARY="zh_CN" LC_PAPER="zh_CN" LC_NAME="zh_CN" LC_ADDRESS="zh_CN" LC_TELEPHONE="zh_CN" LC_MEASUREMENT="zh_CN" LC_IDENTIFICATION="zh_CN"
用sed替换;
[email protected]:~# sed -i‘s/LANG="zh_CN.UTF-8"/LANG="en_US.UTF-8"/g‘/etc/default/locale [email protected]:~# sed -i‘s/LANGUAGE="zh_CN:zh"/LANGUAGE="en_US:en"/g‘ /etc/default/locale
检查结果;
[email protected]:~# cat /etc/default/locale LANG="en_US.UTF-8" LANGUAGE="en_US:en" LC_NUMERIC="zh_CN" LC_TIME="zh_CN" LC_MONETARY="zh_CN" LC_PAPER="zh_CN" LC_NAME="zh_CN" LC_ADDRESS="zh_CN" LC_TELEPHONE="zh_CN" LC_MEASUREMENT="zh_CN" LC_IDENTIFICATION="zh_CN"
*修改完成后注销或reboot系统;
临时修改为英文编码;
[email protected]:~# exportLANG="en_US.UTF-8" [email protected]:~# exportLANGUAGE="en_US:en"
Ubuntu Server乱码解决办法,布布扣,bubuko.com
时间: 2024-10-13 23:30:38