LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 829|回复: 4

我的vi建立的新文件为什么是utf-8编码的?

[复制链接]
发表于 2006-4-11 11:06:41 | 显示全部楼层 |阅读模式
locale
LANG=zh_CN
LANGUAGE=zh_CN:zh:en_US:en
LC_CTYPE="zh_CN"
LC_NUMERIC="zh_CN"
LC_TIME="zh_CN"
LC_COLLATE="zh_CN"
LC_MONETARY="zh_CN"
LC_MESSAGES="zh_CN"
LC_PAPER="zh_CN"
LC_NAME="zh_CN"
LC_ADDRESS="zh_CN"
LC_TELEPHONE="zh_CN"
LC_MEASUREMENT="zh_CN"
LC_IDENTIFICATION="zh_CN"
发表于 2006-4-11 12:07:27 | 显示全部楼层
你应该设置精确的locale而不是简单的zh_CN,比如zh_CN.UTF-8
回复 支持 反对

使用道具 举报

发表于 2006-4-11 12:27:44 | 显示全部楼层
这是由vim设置确定的,在~/.vimrc中,好像是fileencoding这个选项
回复 支持 反对

使用道具 举报

发表于 2006-4-11 13:01:56 | 显示全部楼层
但 vim 手册中说:
  1.         Normally 'encoding' will be equal to your current locale.  This will
  2.         be the default if Vim recognizes your environment settings.  If
  3.         'encoding' is not set to the current locale, 'termencoding' must be
  4.         set to convert typed and displayed text.  See |encoding-table|.
复制代码
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-4-11 13:39:19 | 显示全部楼层
Post by ideawu
你应该设置精确的locale而不是简单的zh_CN,比如zh_CN.UTF-8

我用的是debian,用dpkg-reconfig locales设置的是zh_CN.gb2312,不知道为什么locale显示的却没有后面的部分。
Post by pupilzeng

这是由vim设置确定的,在~/.vimrc中,好像是fileencoding这个选项

现在调整了.vimrc里面相关的项,好了。
现在的文件编码是ISO-8859 text的了。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表