ubuntu中文支持及乱码解决,centos中文乱码及火狐浏览器乱码解决

916 阅读1分钟

ubuntu支持中文及中文乱码解决

  1. 首先安装中文支持包language-pack-zh-hans
apt install language-pack-zh-hans
  1. 然后修改/etc/enviroment配置(在文件末尾增加如下配置)
LANG="zh_CN.UTF-8" 
LANGUAGE="zh_CN:zh:en_US:en"
  1. 修改/var/lib/locales/supported.d/local配置(如果没有就新建)
en_US.UTF-8 UTF-8 
zh_CN.UTF-8 UTF-8 
zh_CN.GBK GBK 
zh_CN GB2312
  1. 执行命令:locale-gen
  2. 中文空格乱码(安装字体即可):apt install fonts-droid-fallback ttf-wqy-zenhei ttf-wqy-microhei fonts-arphic-ukai fonts-arphic-uming

centos中文乱码

  1. 查看centos系统是否安装中文编码:locale -a |grep "zh_CN"
  2. 没有就安装,安装命令:yum groupinstall "fonts" -y
  3. 修改配置/etc/locale.conf,vim /etc/locale.conf
LANG="zh_CN"
  1. 生效配置:source /etc/locale.conf
  2. 也可以使用以下命令修改/etc/locale.conf
localectl set-locale LANG=zh_CN
source /etc/locale.conf

centos火狐浏览器乱码

yum -y groupinstall Fonts