系统:Centos 6.2
Linux localhost.localdomain 2.6.32-220.el6.i686 #1 SMP Tue Dec 6 16:15:40 GMT 2011 i686 i686 i386 GNU/Linux
Linux zhongsx 2.6.32-220.el6.x86_64 #1 SMP Tue Dec 6 19:48:22 GMT 2011 x86_64 x86_64 x86_64 GNU/Linux
VIM : 7.3
目的:vim支持ANSI编码格式,系统正常显示中文
系统:/etc/sysconfig/i18n
LANG="zh_CN.GB18030"
SUPPORTED="zh_CN.UTF-8:zh_CN:zh:en_US.UTF-8:en_US:en:zh_CN.GB18030"
SYSFONT="latarcyrheb-sun16"
SYSFONTACM="utf8"
LANG="zh_CN.GB18030"
LANGUAGE="en_US.UTF-8"
LC_CTYPE="zh_CN.GB18030"
LC_TIME="en_US.UTF-8" VIM:
set fencs=utf-8,ucs-bom,shift-jis,gb18030,gbk,gb2312,cp936
set termencoding=gb2312 "也可以是utf-8
set encoding=gb2312 "也可以是utf-8
set fileencodings=ucs-bom,utf-8,cp936
set fileencoding=utf-8
补充:
CRT上的设置: 字体:选择新宋体, 字体的编码GB2312
知其然,知其所以然。
可以参考这篇文章: