Valery Kondakoff <strauss@...
> Hello, vim-developers!
> It seems, currently it is impossible to edit files with native
> characters in their names, when GVIM enoding is set to UTF-8. (WinXP,
> GVIM 6.1 1-449)
> There is an example: it is possible to open such a file with GVIM
> internal File Explorer or by using 'File - Open' menu item, but the
> name of the file will be damaged, so it will be impossible to write it
> back. The name of the file looks like this after opening in GVIM:
> And it is completely impossible to open a file with native characters
> in the name using ':e' command or from command line - GVIM just does
> not found a file and opens an empty file with damaged name.
> More details: the default Russian character encoding under Windows is
> CP1251. So, the filenames with Russian characters are stored in this
> encoding. There are my GVIM language settings:
> set encoding=utf-8
> set fileencoding=cp1251
> set fileencodings=cp1251,cp866,koi8-r,latin1
> If there is something we can do about this? Thank you.
> Best regards,
> Valery Kondakoff
> http://www.nbk.orc.ru (Ne Bey Kopytom)
> http://www.nbk.orc.ru/mtb (MTB riding in Moscow)
> PGP key:
There ought to be something better, but just as a makeshift temporary
solution, which I believe could be automated by means of a .BAT file (the
actual writing of it is left as an exercise to the reader ha ha):
(a) Copy or rename to a non-yet-existing ASCII name (either a "temporary
workfile name", guaranteed by the OS to be unique, or a user-chosen name
which will not be used for any permanent file -- maybe something like
GVIMDATA.$$$ or maybe even GVIMWORK.001, GVIMWORK.002 etc., testing for "IF
EXIST" and using only if it doesn't)
(b) If (a) succeeds, edit the file under the name just created
(c) If (b) succeeds, rename back to the original name.
(d) If any of the above does *not* succeed (ERRORLEVEL too high), give
(ECHO) an error message describing the error.