Have Vim fully support UTF-8 on Windows

后端 未结 2 1056
慢半拍i
慢半拍i 2021-01-01 04:46

I use vim and gVim on Windows, and vim in a virtual Linux box for programming. Often I need to change gettext catalog fi

2条回答
  •  滥情空心
    2021-01-01 05:26

    The only way I have been able to consistently change file-encoding to UTF-8 on windows is by using notepad++ or powershell (see below). Regardless of the VIM version changing the file encoding from within VIM is gives inconsistent results at best.

    Once the file has UTF-8 encoding set outside of vim there are no further issues. File encoding set through vim on linux or mac are respected by windows.

    In this thread of powershell command is suggested to change the encoding. That is the fastest way I know of to set a project to UTF-8 on windowws and work without further hassle.

    In your examples above, not that there is a difference between :set encoding=utf-8 (which is temporary and only in your display) and set fileencoding=utf-8 which will change the file on save.

提交回复
热议问题