ubuntu打开文件出现乱码

在ubuntu 16.04下,

(1)用gedit打开文件出现乱码,解决办法:

https://blog.csdn.net/kang99827765/article/details/51426855


(2)用vim打开文件出现乱码,解决办法:

打开 ~/.vimrc文件,添加下面两句:

set fileencodings=utf-8,gb2312,gbk,gb18030
set termencoding=utf-8


(3)用eclipse打开文件出现乱码,有3中方式解决:

1)全局修改,所有工程都有影响。

        首先Windows->Preferences, 然后选择General下面的Workspace. Text file encoding选择Other GBK, 如果没有GBK的选项, 没关系, 直接输入GBK三个字母, Apply, GBK编码的中文, 已经不是乱码了。

2)工程修改,其他工程没有影响。

         右键点击工程,选择Preferences,在Text file encoding选择Other GBK。

3)包修改。

         右键点击包,选择Preferences,在Text file encoding选择Other GBK。         

4)文件修改。

        右键点击文件,步骤如上。




猜你喜欢

转载自blog.csdn.net/gs344937933/article/details/80712938