On Mon, Oct 11, 2010 at 01:01:48AM +0800, H Xu wrote: > Hello Bram, > The way to reproduce it is simple: open a new file: > vim test.txt > > test.txt must not exist. > Then input some letters and use ":w" to save the file. now check the > value of "fileencoding": it is empty, while it should be some value. > > I don't think this is what intended to be. Thank you.
It is intended and it's documented under the help section for ++enc: Note that when reading, the 'fileformat' and 'fileencoding' options will be set to the used format. When writing this doesn't happen, thus a next write will use the old value of the option. Same for the 'binary' option. ":w ++enc=..." is specifically for writing out a file with a different encoding but not changing the encoding of the buffer. If you want to actually change the encoding of the buffer and affect the encoding used when writing out the file, then ":set fileencoding=...". -- James GPG Key: 1024D/61326D40 2003-09-02 James Vega <[email protected]>
signature.asc
Description: Digital signature
