在Ubuntu 的系统,打开火狐浏览器,进入百度首页,显示的乱码如图所示:
尝试用浏览器打开,
在文字编码 或者 Text Encoding 中,
更换编码格式不能选择,除了Unicode选中,其他都无法点击。
解决方案(从网上获取):
第一种方式
1.安装wqy-zenhei字体
apt-get install ttf-wqy-zenhei
2.修改系统字体配置文件/etc/fonts/conf.d/49-sansserif.conf
打开/etc/fonts/conf.d/49-sansserif.conf这个文件:
vim /etc/fonts/conf.d/49-sansserif.conf
然后修改倒数第四行的字体为WenQuanYi Zen Hei,如下:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!--
If the font still has no generic name, add sans-serif
-->
<match target="pattern">
<test qual="all" name="family" compare="not_eq">
<string>sans-serif</string>
</test>
<test qual="all" name="family" compare="not_eq">
<string>serif</string>
</test>
<test qual="all" name="family" compare="not_eq">
<string>monospace</string>
</test>
<edit name="family" mode="append_last">
<string>WenQuanYi Zen Hei</string>
</edit>
</match>
</fontconfig>
3.重启chrome,或者火狐浏览器,即可
第二种方式
其他服务区也可以卸载后在重装
1、卸载
sudo apt-get remove firefox
2、安装
sudo apt-get install firefox
3、设置成中文
sudo apt-get install firefox-locale-zh-hans
再打开浏览器看是否成中文。
亲测第一种有效