原因:linux默认的解码为utf8,而要正常显示就要转换成gb18030.
处理前系统要求:需要已经安装了Configuration Editor(配置编辑器),fedora默认是没有安装gconf-editor的。可在终端运行yum install gconf-editor 即可安装。此后在运行
gconf-editor命令,有可能遇到错误提示:
症状:
GConf Error:联系配置服务器失败;某些可能原因是需要为 ORBit 启用 TCP/IP 联网,或者由于系统崩溃,您的 NFS
锁定已失效。请访问 http://projects.gnome.org/gconf/ 了解详细信息。(详细信息 - 1:
获取到会话的连接失败:Did not receive a reply. Possible causes include: the remote
application did not send a reply, the message bus security policy
blocked the reply, the reply timeout expired, or the network connection
was broken.)
解决办法:
切换用户时不要使用 su 而要使用 "su - root
"注意‘-’两端都有空格。
附加:
su 和 su- 的区别
:
su user保留原来exported的环境变量,而su - user就像以用户user登陆进来一样,重新初始化环境变量。
回归正题解决
步骤:
1,终端输入命令gconf-editor
2,
打开了Configuration Editor(配置编辑器)。依次打开:apps-->gedit2-->preferences-->encodings
双击右边的“auto_detected"-->"add"-->输入:gb18030 -->OK
-->点UP把它移动到最上边-->OK.这样就可以用gedit正常显示中文了。
Fedora中txt文件乱码问题的解决
最新推荐文章于 2024-12-06 10:54:35 发布
本文介绍如何通过修改配置让Linux下的gedit正确显示中文。首先需要安装ConfigurationEditor,并使用特定命令进行设置。文章还解释了su和su-的区别。
541

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



