ubuntu下打开txt文件,显示乱码,解决方法如下:
方法一:
终端输入gconf-editor调出gconf-edit (如若没安装请用 sudo apt-get install gconf-editor 命令安装)
PS:输入gconf-editor即可,前面不需要加Sudo
依次点开
apps->gedit-2->preferences->encodings
中的auto-detected
在双击弹出对话框中加入GB18030,GBK,GB2312,然后将GB18030,GB2312移到最上
方法二:
终端输入 sudo apt-get install dconf-tools 安装,然后输入sudo dconf-editor调出dconf-editor
依次点开
org->gnome->gedit->prefrences->encoding中的auto-detected的value改为:['GB18030',
'GB2312', 'GBK', 'UTF-8', 'CURRENT', 'ISO-8859-15', 'UTF-16'],回车即可。
我用的是第二种方法,因为新安装的ubuntu的gconf-editor里面没有auto-detected,而且新手一般不会设置。
本文介绍了在Ubuntu环境下解决打开txt文件时出现乱码问题的两种方法。方法一通过使用gconf-editor进行配置,方法二则推荐使用dconf-editor进行更为直观的操作。具体步骤包括在gconf-editor或dconf-editor中调整编码设置,将GB18030、GBK、GB2312等编码置于首位。


被折叠的 条评论
为什么被折叠?



