I work on webpages involving Non-English scripts from time to time, most of them uses utf-8 charset, VIM and Gvim does not display UTF-8 Characters correctly.
Using
In Linux, Open the VIM configuration file
$ sudo -H gedit /etc/vim/vimrc
Added following lines:
set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936
set termencoding=utf-8
set encoding=utf-8
Save and exit, and terminal command:
$ source /etc/vim/vimrc
At this time VIM will correctly display Chinese.
On Windows gvim just select "Lucida Console" font.
Did you try
:set encoding=utf-8
:set fileencoding=utf-8
?
On Microsoft Windows, gvim wouldn't allow you to select non-monospaced fonts. Unfortunately Latha is a non-monospaced font.
There is a hack way to make it happen: Using FontForge (you can download Windows binary from http://www.geocities.jp/meir000/fontforge/) to edit the Latha.ttf and mark it as a monospaced font. Doing like this:
Good luck!
this work for me and do not need change any config file
vim --cmd "set encoding=utf8" --cmd "set fileencoding=utf8" fileToOpen
Is this problem solved meanwhile?
I had the problem that gvim didn't display all unicode characters (but only a subset, including the umlauts and accented characters), while :set guifont?
was empty; see my question. After reading here, setting the guifont
to a sensible value fixed it for me. However, I don't need characters beyond 2 bytes.