用ubuntu自带的gedit打开.txt文件的时候显示的是乱码。

解决:ubuntu下gedit打开cmd乱码,自定义为GB18030编码打开:

gedit --encoding=GB18030 filename.txt

或直接执行以下命令:

gsettings set org.gnome.gedit.preferences.encodings auto-detected "['UTF-8','GB18030','GB2312','GBK','BIG5','CURRENT','UTF-16']"