I've started to write some personal working logs in Markdown syntax with Vim. It's simple and quick. But when I tried to compile the plain text into HTML file, the Chinese characters introduced trouble for the Python implementation of Markdown. The error message was something like:
UnicodeDecodeError: 'utf8' codec can't decode byteTo prevent this kind of error, I thought the best approach was to make Vim work with Unicode in my Windows. The settings were added in C:\Program Files\Vim\_vimrc and they are as follows:
set fileencoding=utf8
set fileencodings=ucs-bom,utf-8,default,latin1
The first line tells Vim to save the text in utf8 and the second line gives Vim to open and convert the files in the given order of encoding.
No comments:
Post a Comment