On 03/09/09 11:51, Casufi wrote:
>
> Hello.
> Is it possible to configure encoding autodetection for vim in MS
> Windows? I can't find enca win32 binaries to configure it in usual way.

By default, on Windows as on any other platform, Vim will start with 
'encoding' set to your locale, i.e., to the encoding defined by your 
"Country settings" or whatever it is called.

This does not suit everybody.

What I recommend to be able to edit any files, is to use Unicode to 
represent the data internally, see 
http://vim.wikia.com/wiki/Working_with_Unicode

Even that way, there are so many possible file-encodings out there that 
it is not always possible to correctly detect _everything_. You can set 
'fileencodings' (plural) (q.v.) to automatically detect at least the 
following (with a single setting):
        - any Unicode file which has a BOM at its start;
        - UTF-8 files even with no BOM;
        - the one 8-bit encoding you use most often (on Windows, you might for 
instance set this to Windows-1252 if you're part of the so-called 
"Western" world). An example setting for this purpose (after you've set 
Unicode) would be
        set fileencodings=ucs-bom,utf-8,cp1252

For other files (those in "rarer" encodings from your POV), you must 
know the file-encoding yourself (or find it by trial and error) and tell 
it to Vim when opening the file, by using a ++enc= modifier to the ":e" 
":view" ":new" ":sview" and similar commands (see ":help ++opt).

Note that for ++enc= to work as one would expect, you should use a 
"reasonably recent" Vim version. I can't find back which was the latest 
bugfix applying to that setting though. FWIW, as of this writing the 
"latest" Vim version and patchlevel is 7.2.262, as displayed by the 
"intro" command (and in more detail by the ":version" command).

For Windows, if you don't want to compile Vim yourself, a good 
precompiled distribution of Vim can usually be found as the latest 
version of the "Vim" product, in the form of a self-installer named 
gvim-7-2-xxx.exe (where xxx is the patchlevel, the higher the better), 
available from https://sourceforge.net/projects/cream/files/


Best regards,
Tony.
-- 
Clothes make the man.  Naked people have little or no influence on
society.
                -- Mark Twain

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to