400 028 6601

建站动态

根据您的个性需求进行定制 先人一步 抢占小程序红利时代

VIM字符编码相关操作

一、Reloading a file using a different encoding
:e ++enc=
如:
:e ++enc=cp936
或者编辑/etc/vimrc文件,把cp936/gb18030编码加入到文件编码列表中
set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1

如仍为乱码,则检查本地环境变量是否正常:
#locale
如LANG为空,则需设置为:
export LANG=en_US.utf8
重新执行上述步骤即可。

二、Setting a file using a different fileformat
:e ++ff=dos
:e ++ff=unix
:set fileformat

清除“^M” 字符
:%s/\r//g


文章标题:VIM字符编码相关操作
网页路径:http://mbwzsj.com/article/isjcij.html

其他资讯

让你的专属顾问为你服务