Article turned from: HTTP://WWW.LIUHUADONG.COM/ARCHIVES/68
The ultimate solution for vim and Gvim in Chinese garbled under windows
In Windows Vim's Chinese font display is not good, so we need to adjust the font display encoding utf-8, only in order to use beautiful Chinese. There may be a lot of Chinese garbled.
Such as:
File display garbled, menu garbled, right-click menu garbled, conlse output garbled, file association Right-click menu garbled and so on.
Online a lot of solutions, but I tried a lot, all appeared some weird garbled, forgotten how.
There is an easy way to solve the garbled problem: delete the lang directory under Vim. However, all menus can only be displayed in English.
So I had to find a way. After a long period of groping, summarize the following code can completely solve these problems.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" vim7.1在windows下的编码设置。By Huadong.Liu
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set encoding=utf-8
set fileencodings=utf-8,chinese,latin-1
if has("win32")
set fileencoding=chinese
else
set fileencoding=utf-8
endif
"解决菜单乱码
source $VIMRUNTIME/delmenu.vim
source $VIMRUNTIME/menu.vim
"解决consle输出乱码
language messages zh_CN.utf-8
The ultimate solution for VIM and Gvim in Chinese garbled under windows