I have a text file. I've been told to make it UTF8. How can I do that with Vim?
相关问题
- Emacs shell: save commit message
- WebElement.getText() function and utf8
- How to change the first two uppercase characters o
- Insert text into current buffer from function
- Hot reload on save
相关文章
- 如何让 vim 支持 .cshtml 文件的代码高亮
- Auto-save in VIM as you type
- How can I use gcc's -I command to add recursiv
- Spanish Characters in HTML Page Title
- Vim: overloaded mapping for multiple modes
- How to use relative line numbering universally in
- Base64 Encoding: Illegal base64 character 3c
- How to read the Content Type header and convert in
to write the file in utf-8 encoding to disk.
If you are editing a file encoded as latin1, you will find that 'fileencoding' for that buffer is set to latin1. So you will need to manually set the fileencoding before saving the file.
Also note that UTF8 files often begin with a Byte Order Mark (BOM) which indicates endianness. The BOM is optional but some programs use it exclusively to determine the file encoding. Under certain conditions Vim will write the BOM but sometimes it won't. To explicitly set the BOM do this:
For more information
:help mbyte-options
and:help utf8
and:help bomb
.