Ubuntu16.04中文字符乱码问题的解决方法
2017-05-15 22:12
656 查看
Ubuntu16.04中文字符乱码问题的解决方法:
一、打开终端,输入sudo gedit /etc/default/locale (或者直接打开该目录下对应的文件)。
二、将第一默认的字符编码改为utf-8:
LANG=zh_CN.UTF-8
LANGUAGE=”zh_CN:zh:en_US:en”
三、重启电脑即可。
在中文支持配置还不完整的Ubuntu 14.04中,使用gedit打开带有中文字符的文件有时会出现乱码的情况,这是由于gedit对字符编码匹配不正确导致的,解决方法如下:
在终端中输入如下命令,然后重新打开gedit即可:
gsettings set org.gnome.gedit.preferences.encodings auto-detected "['GB18030', 'GB2312', 'GBK', 'UTF-8', 'BIG5', 'CURRENT', 'UTF-16']"
gsettings set org.gnome.gedit.preferences.encodings shown-in-menu "['GB18030', 'GB2312', 'GBK', 'UTF-8', 'BIG5', 'CURRENT', 'UTF-16']"
更新到16.04,gedit打开中文时,依然存在乱码的问题。ubuntu官方给出的解决方案是,gedit3.x以上版本的在命令终端输入命令:
gsettings set org.gnome.gedit.preferences.encodings auto-detected “[‘GB18030’, ‘UTF-8’, ‘CURRENT’, ‘ISO-8859-15’, ‘UTF-16’]” 来解决。
但是输入命令后提示无”auto-detected”键值。 看来键值真的是更改了,可以直接在dconf-editor下把”candidate-encodings”的值更改为”[‘GB18030’, ‘UTF-8’,
‘CURRENT’, ‘ISO-8859-15’, ‘UTF-16’]”。
打开终端,在其中输入命令:
sudo dconf-editor
如果dconf-editor没安装,先使用sudo apt-get install dconf-editor 安装.
问题找到了,如果用命令进行更改的话,可以输入命令
1. 打开终端,在其中输入命令:
sudo dconf-editor
如果dconf-editor没安装,先使用sudo apt-get install dconf-editor 安装。
2. 在新开的窗口里,在左边依次展开/org/gnome/gedit/perferences/encodings,修改其中的配置信息,在auto-detected项的value中的'UTF-8'后面添加, 'GB18030',在shown-in-menu对应值的后面添加上, 'GB18030'(注意逗号后面有个空格)。关闭然后再次运行Gedit即可生效。
gsettings set org.gnome.gedit.preferences.encodings candidate-encodings “[‘GB18030’, ‘UTF-8’, ‘CURRENT’, ‘ISO-8859-15’, ‘UTF-16’]” 来解决。
https://my.oschina.net/kevin701/blog/228971?p={{currentPage-1}} 成功安装fcitx.
http://jingyan.baidu.com/article/4853e1e565e1781908f7266c.html 卸载顶部面板任务栏上的键盘指示。
一、打开终端,输入sudo gedit /etc/default/locale (或者直接打开该目录下对应的文件)。
二、将第一默认的字符编码改为utf-8:
LANG=zh_CN.UTF-8
LANGUAGE=”zh_CN:zh:en_US:en”
三、重启电脑即可。
在中文支持配置还不完整的Ubuntu 14.04中,使用gedit打开带有中文字符的文件有时会出现乱码的情况,这是由于gedit对字符编码匹配不正确导致的,解决方法如下:
在终端中输入如下命令,然后重新打开gedit即可:
gsettings set org.gnome.gedit.preferences.encodings auto-detected "['GB18030', 'GB2312', 'GBK', 'UTF-8', 'BIG5', 'CURRENT', 'UTF-16']"
gsettings set org.gnome.gedit.preferences.encodings shown-in-menu "['GB18030', 'GB2312', 'GBK', 'UTF-8', 'BIG5', 'CURRENT', 'UTF-16']"
更新到16.04,gedit打开中文时,依然存在乱码的问题。ubuntu官方给出的解决方案是,gedit3.x以上版本的在命令终端输入命令:
gsettings set org.gnome.gedit.preferences.encodings auto-detected “[‘GB18030’, ‘UTF-8’, ‘CURRENT’, ‘ISO-8859-15’, ‘UTF-16’]” 来解决。
但是输入命令后提示无”auto-detected”键值。 看来键值真的是更改了,可以直接在dconf-editor下把”candidate-encodings”的值更改为”[‘GB18030’, ‘UTF-8’,
‘CURRENT’, ‘ISO-8859-15’, ‘UTF-16’]”。
打开终端,在其中输入命令:
sudo dconf-editor
如果dconf-editor没安装,先使用sudo apt-get install dconf-editor 安装.
问题找到了,如果用命令进行更改的话,可以输入命令
1. 打开终端,在其中输入命令:
sudo dconf-editor
如果dconf-editor没安装,先使用sudo apt-get install dconf-editor 安装。
2. 在新开的窗口里,在左边依次展开/org/gnome/gedit/perferences/encodings,修改其中的配置信息,在auto-detected项的value中的'UTF-8'后面添加, 'GB18030',在shown-in-menu对应值的后面添加上, 'GB18030'(注意逗号后面有个空格)。关闭然后再次运行Gedit即可生效。
gsettings set org.gnome.gedit.preferences.encodings candidate-encodings “[‘GB18030’, ‘UTF-8’, ‘CURRENT’, ‘ISO-8859-15’, ‘UTF-16’]” 来解决。
https://my.oschina.net/kevin701/blog/228971?p={{currentPage-1}} 成功安装fcitx.
http://jingyan.baidu.com/article/4853e1e565e1781908f7266c.html 卸载顶部面板任务栏上的键盘指示。
相关文章推荐
- ubuntu10.04中文乱码问题解决方法
- 解决ubuntu中文乱码问题的方法总结
- 解决ubuntu中文乱码问题的方法总结
- MySQL字符集中文乱码终极解决方案和mysql查询中文问题解决方法[转贴]
- 解决ubuntu中文乱码问题的方法总结
- ubuntu系统,firefox下,flash里的中文乱码的问题 解决方法
- VC轻松解析XML文件--CMarkup使用方法(解决解析中文字符出现乱码问题)
- 中文字符乱码问题的解决方法
- ubuntu下gedit打开txt中文乱码问题解决方法
- 解决ubuntu中文乱码问题的方法总结
- Ubuntu下Geany解决中文字符乱码的简单方法
- JSP页面编码问题研究三(中文字符乱码问题的解决方法)
- MySQL字符集中文乱码终极解决方案和mysql查询中文问题解决方法[转贴]
- MySQL字符集中文乱码终极解决方案和mysql查询中文问题解决方法[转贴]
- MySQL字符集中文乱码终极解决方案和mysql查询中文问题解决方法[转贴]
- SQLServer乱码问题的分析及解决方法(中文字符被存入数据库后,显示为乱码)
- VC轻松解析XML文件--CMarkup使用方法(解决解析中文字符出现乱码问题)
- 解决ubuntu中文乱码问题的方法总结
- Ubuntu/Debian下JAVA 中文/图片中文字体乱码显示问题解决方法
- 解决ubuntu中文乱码问题的方法总结