在linux下用vim写好代码a.c后,在xp里打开文件,变成乱码了。a.c这个文件为utf8格式的,我在linux里想把a.c转换成iso88592格式的。
但是转换失败,原因是a.c里的中文字符造成的。如果a.c里面没有中文字符的话就可以转换成功。请问应该怎么解决这个问题呢?
[test@localhost ~]$ file a.c
a.c: UTF-8 Unicode text
[test@localhost ~]$ cat a.c
中
[test@localhost ~]$ iconv -f utf8 -t iso88592 a.c
iconv: illegal input sequence at position 0
我的~/.vimrc里编码是这样设置的.
set encoding=utf-8
set fileencodings=utf-8,gbk,cp936###
[test@localhost ~]$ file a.c
a.c: UTF-8 Unicode text
[test@localhost ~]$ cat a.c
中
[test@localhost ~]$ iconv -f utf8 -t iso88592 a.c
iconv: illegal input sequence at position 0
我的~/.vimrc里编码是这样设置的.
set encoding=utf-8
set fileencodings=utf-8,gbk,cp936###
作者: e3399 发布时间: 2011-01-11
写代码,最好用英文注释。
作者: wenxy1 发布时间: 2011-01-11
编码问题,在Linux下设置好编码方式Unicode,在Windows下用Word或者是写字板打开
作者: Harry_lyc 发布时间: 2011-01-11
引用 1 楼 wenxy1 的回复:
写代码,最好用英文注释。
写代码,最好用英文注释。
嗯。以后我会往这方面去学。用英文注释。。
作者: e3399 发布时间: 2011-01-11