Vim 不能将文件编码转换为GB18030

Vim、Emacs配置和使用
回复
头像
liumailong
帖子: 244
注册时间: 2008-02-12 6:41

Vim 不能将文件编码转换为GB18030

#1

帖子 liumailong » 2011-11-01 16:18

今天才发现这个问题!
比如一个编码为 UTF-8 的文件,:set fenc=GBK 没问题
换成 :set fenc=GB18030 就不行了.
GB18030 这东西果然爹不疼,娘不爱.........
:em06
头像
eexpress
帖子: 58428
注册时间: 2005-08-14 21:55
来自: 长沙

Re: Vim 不能将文件编码转换为GB18030

#2

帖子 eexpress » 2011-11-01 16:41

没必要转啊。你如果cp到win分区,会自动转的。
● 鸣学
头像
liumailong
帖子: 244
注册时间: 2008-02-12 6:41

Re: Vim 不能将文件编码转换为GB18030

#3

帖子 liumailong » 2011-11-01 17:04

eexpress 写了:没必要转啊。你如果cp到win分区,会自动转的。
你说的是文件名吧!
我说的是文件内容。
:em04
头像
lilydjwg
论坛版主
帖子: 4258
注册时间: 2009-04-11 23:46
系统: Arch Linux
联系:

Re: Vim 不能将文件编码转换为GB18030

#4

帖子 lilydjwg » 2011-11-01 17:55

liumailong 写了:今天才发现这个问题!
比如一个编码为 UTF-8 的文件,:set fenc=GBK 没问题
换成 :set fenc=GB18030 就不行了.
GB18030 这东西果然爹不疼,娘不爱.........
:em06
我这里可以。我很奇怪,你们问问题的为什么很多都不会表达:什么叫“不行”?什么叫“报错”?什么叫“失败”?先好好想想以下几个问题再提问吧

代码: 全选

What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?


What version of the product are you using? On what operating system?


Please provide any additional information below.
头像
liumailong
帖子: 244
注册时间: 2008-02-12 6:41

Re: Vim 不能将文件编码转换为GB18030

#5

帖子 liumailong » 2011-11-01 18:32

lilydjwg 写了:
liumailong 写了:今天才发现这个问题!
比如一个编码为 UTF-8 的文件,:set fenc=GBK 没问题
换成 :set fenc=GB18030 就不行了.
GB18030 这东西果然爹不疼,娘不爱.........
:em06
我这里可以。我很奇怪,你们问问题的为什么很多都不会表达:什么叫“不行”?什么叫“报错”?什么叫“失败”?先好好想想以下几个问题再提问吧

代码: 全选

What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?


What version of the product are you using? On what operating system?


Please provide any additional information below.
这个........
我只是想发表一下感慨而已。
:em06

单就这个问题,Linux 下我没有试,Win 下我用了最新的稳定版试过了确实有这个问题.
头像
liumailong
帖子: 244
注册时间: 2008-02-12 6:41

Re: Vim 不能将文件编码转换为GB18030

#6

帖子 liumailong » 2011-11-01 19:06

刚刚试了,在 Linux 下确实没问题。
头像
lilydjwg
论坛版主
帖子: 4258
注册时间: 2009-04-11 23:46
系统: Arch Linux
联系:

Re: Vim 不能将文件编码转换为GB18030

#7

帖子 lilydjwg » 2011-11-01 20:43

liumailong 写了:单就这个问题,Linux 下我没有试,Win 下我用了最新的稳定版试过了确实有这个问题.
Win 下用这个做什么,它下面的 GB* 都是一样的。另外,Vim 不存在所谓的稳定版:凡是官方发布的(源码)都可以认为是稳定的。
头像
eexpress
帖子: 58428
注册时间: 2005-08-14 21:55
来自: 长沙

Re: Vim 不能将文件编码转换为GB18030

#8

帖子 eexpress » 2011-11-02 9:35

原来你的主环境,是在win啊。
那真没必要搞这些。
● 鸣学
头像
Strange
帖子: 1824
注册时间: 2006-05-19 9:54
来自: Shanghai

Re: Vim 不能将文件编码转换为GB18030

#9

帖子 Strange » 2011-11-02 10:16

windows下
:set fenc=GB18030
也没问题的...
ニンニク入れますか?
x60 with gentoo
头像
liumailong
帖子: 244
注册时间: 2008-02-12 6:41

Re: Vim 不能将文件编码转换为GB18030

#10

帖子 liumailong » 2011-11-02 13:34

Strange 写了:windows下
:set fenc=GB18030
也没问题的...
我 XP 和 win7 下都不行。你是怎么做到的?
niejieqiang
帖子: 151
注册时间: 2009-05-29 22:05

Re: Vim 不能将文件编码转换为GB18030

#11

帖子 niejieqiang » 2011-11-02 13:43

:em20 楼上几位都把gb18030当成 2312或gbk了。。

vim或emacs用来处理gb18030先天性不足。
推荐gbpad。
windows下推荐cnbook,texpro等
头像
liumailong
帖子: 244
注册时间: 2008-02-12 6:41

Re: Vim 不能将文件编码转换为GB18030

#12

帖子 liumailong » 2011-11-02 13:47

niejieqiang 写了::em20 楼上几位都把gb18030当成 2312或gbk了。。

vim或emacs用来处理gb18030先天性不足。
推荐gbpad。
windows下推荐cnbook,texpro等
我也怀疑 9 楼 搞错了
:em06
头像
自由建客
帖子: 13468
注册时间: 2008-07-30 23:21
系统: Debian stable AMD64

Re: Vim 不能将文件编码转换为GB18030

#13

帖子 自由建客 » 2011-11-02 21:19

gb18030 是 gbk 的超集,你既然能从 utf-8 转成 gbk ,再试图转成 gb18030 自然是没有任何效果的,重开文档仍会被识别成 gbk 。
你要测试 gb18030 就要用些非 gbk 字符,和 utf-8 可互转没有问题,但不能转成 gbk !
回复