2008/11/13 James Kanze <[EMAIL PROTECTED]>: > > How does vim decide what encoding(s) to use when it opens an > existing file? > > I ask this because in the past, with text files, it seems to > have "just worked", and with C++ files and shell scripts, it > never mattered, since they only contained ASCII. However, I've > now got some C++ files which have French (with accents) in their > comments. The standard header that we use (copyright, etc.) is > in English, as is all of the program text itself, which means > that there is a large block of pure ASCII at the start. I'm > gradually converting everything from Latin 1 to UTF-8, however; > I use vim for the conversion (read, change fileencoding, > rewrite), which works fine, but the next time I read the file, > vim still treats it as if it were Latin 1 unless I manually > change encoding (and fileencoding?) > > As far as I can tell, I've nothing in any of my configuration > files which specify an encoding.
This doesn't answer your question, but have you considered adding a modeline to the end of the files, something like: /* vim:set encoding=utf-8 : */ Also see :help 'fileencoding' :help 'fileencodings' (note the 's' on the end) Al --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
