ubuntu系统下gedit 打开GBK字符集编码文件出现乱码问题解决办法
来源:互联网 发布:无锡移动数据招聘 编辑:程序博客网 时间:2024/04/30 19:51
使用 Gedit 打开 Windows 系统下编写的文本文件时,文件的中文全是乱码。
有些在Windows下能够打开的txt文件在Ubuntu下用gedit打开时,中文显示是乱码,这是因为编码方式不同造成的。Windows下默认txt文件的编码方式是GBK,而Ubuntu下的gedit默认没有对GBK的支持。
简单的方法如下:
打开终端,输入如下两条指令,
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']"
重新启动 Gedit ,就能够正常显示中文内容了。
上述两条指令相当于打开 应用程序-系统工具-配置编辑器(或者在终端里输入:gconf-editor——此软件需要安装——执行sudo apt-get install gconf-editor),在 apps/gedit-2/preferences/encodings 下建立 auto-detected shown-in-menu 两个子键,子键内容如上。
完成上述设置后,gedit就可以自动检测文本文件的字符集,并正确显示 windows 下创建的文本以GBK文件了
<script type="text/javascript"><!--google_ad_client = "ca-pub-1944176156128447";/* cnblogs 首页横幅 */google_ad_slot = "5419468456";google_ad_width = 728;google_ad_height = 90;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
- ubuntu系统下gedit 打开GBK字符集编码文件出现乱码问题解决办法
- debian下gedit 打开GBK字符集编码文件出现乱码
- 缺省配置下,用 Ubuntu 的文本编辑器(gedit)打开 GB18030/GBK/GB2312 等类型的中文编码文本文件时,将会出现乱码
- 【转载】小问题解决之:ubuntu下gedit 打开windows下文件出现中文乱码
- ubuntu下txt打开乱码-解决方案-设置ubuntu linux的系统字符集为GBK
- ubuntu下gedit打开txt中文乱码问题解决方法
- Ubuntu系统下Gedit 打开windows下的文本文件出现乱码解决方法
- ubuntu gedit中文乱码的问题解决办法
- Ubuntu Gedit中文乱码问题解决办法
- vim / gedit 打开GBK文件乱码问题
- 刚安装好Ubuntu系统用Gedit 打开windows下的文本文件出现乱码解决方法
- Ubuntu下解决Gedit 打开文本文件出现乱码
- ubuntu用gedit打开 txt文件出现乱码的解决办法
- Ubuntu 14.04中gedit打开文件出现中文乱码问题
- ubuntu gedit打开文件出现中文乱码问题
- Ubuntu 14.04中gedit打开文件出现中文乱码问题
- Ubuntu 14.04中gedit打开文件出现中文乱码问题
- Ubuntu 14.04中gedit打开文件出现中文乱码问题
- 求助???????????
- 设计模式推演——整合已有系统接口(Facade/Adapter)
- linux tcpdump命令以及结果分析
- 某公司有几万名员工,请完成一个时间复杂度为O(n)的算法对该公司员工的年龄作排序,可使用O(1)的辅助空间
- MIN(1)一排石头的游戏
- ubuntu系统下gedit 打开GBK字符集编码文件出现乱码问题解决办法
- java读utf8文件第一行开头出现"?"乱码
- Spring 国际化资源
- NLP software package
- Android基础教程之-------Android中两种设置全屏的方法
- Linux下使用BenchmarkSQL测试PostgreSQL
- vs2008下MFC中采用ado连接MySQL(ODBC、非ODBC或C API方式)
- zoj 2682 People like People
- vim 快速选中并复制粘贴替换一个单词