From: Alecs K. <al...@pe...> - 2005-11-20 06:38:03
|
On Sat, Nov 19, 2005 at 05:23:34AM +0800, Dasn wrote: > Hi, list! > I just found this thread via Web and was sorry for coming back that > late. Welcome back. > 'fileencoding' option is null. The most tricky stuff comes when you edit > the files with "notepad.exe", all things look fine in Notepad, then I > "save as..." the file in UTF-8 format. Open it again with gvim, now, Vim > can recognize the file encoding and auto convert to cp936. The files I > had commited were formated like this. Yeah, this indeed causes the problem. utf8->cp936->utf8. As we have discussed in this thread, cp936 is in fact gbk, which sometimes is not friendly to our enc-cn (aka gb2312) users when your file contains a gbk-only character that does not exist in the gb2312 encoding. We want our vimcdoc as much encoding-independent as possible. Users can use euc-cn/gb2312, gbk/cp936, utf8 and they dont have to know about the underlying conversion that Vim itself has done when displaying the help file. We make this transparent to users and they dont have to bother doing any conversion themselves. They just :help and see. This means we translators have to 1) edit our file utf-8 native. we dont manually do any conversion whatsoever. 2) make sure the utf8-encoded file _can_ be successfully converted to gb2312, since gb2312 is the very subset. > Recently, I have to use "fileencodings=utf8" in _vimrc to force Vim to > treat all kinds of files as UTF-8 encoding. I think fileencodings=utf8 is the rite way to go. FYI, it does not treat _all_ files as utf-8. It just treats utf8 (which includes ascii) files as utf8. Well, this only ensures the condition 1) above. If you write some 'evil' characters, the file still cannot be converted to gb2312. I wonder if there are similar tools on Windoze like this: $ iconv -f utf-8 -t euc-cn file > /dev/null which can help you check the validity. > The newly 'cmdline.txt' was > generated this way, I wonder whether it'll be okay for other platforms. Checked, ok. -- Alecs King |