On Tue, Aug 20, 2002 at 10:42:23AM +0200, Bram Moolenaar wrote: > > do also: > > set fileencoding=utf-8 > > so that you do not encounter those nasty CONVERSION ERRORs > > The value of 'fileencoding' is changed as soon as you open a file. It's > used to remember the encoding of the file (can be different from the > encoding used inside Vim). You can also change it after reading a file, > so that ":w" writes it with a different encoding.
Well, is this exact? My default fenc is "cp1252" (as I'm using the test setting I mentioned). If I load a UTF-8 file, fenc becomes UTF-8. But, if I then :new, the new window is created with fenc=cp1252, despite fenc being UTF-8. Doing a :set fenc in each window then shows that it's different for each, but :new always creates fenc=cp1252. This makes me conclude that there's a "global" fenc, which determines the default encoding of new files, and a "local" fenc to each window, marking the encoding of that file. That's fine, except it seems undocumented, and it's not clear how to explicitely set the "global" fenc versus the current "local" one. > You probably want to set 'fileencodings' to "utf-8" or make it empty. > Then Vim won't check for a BOM or fall back to using latin1. You still > get CONVERSION ERRORs when editing a file with an illegal byte sequence, > and that's a good hint for the user. It'll also set the file readonly, though, which probably isn't wanted here. -- Glenn Maynard -- Linux-UTF8: i18n of Linux on all levels Archive: http://mail.nl.linux.org/linux-utf8/
