How to view UTF-8 Characters in VIM or Gvim
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 VIM 7.3.46 on windows 7 64 bit, with set guifont=Monaco:h10
in _vimrc
Is there a way to fix this?
Update: I've googled around and found set guifontwide
acts as second fallback for regional languages.
I added the following lines in _vimrc and most of my problems got solved.
set enc=utf-8
set fileencoding=utf-8
set fileencodings=ucs-bom,utf8,prc
set guifont=Monaco:h11
set guifontwide=NSimsun:h12
The above NSimsun font works for Chinese, The problem is I don't know how they got the font name to work with VIM, Courier New
is mentioned as Courier_New
also NSimsun
is nowhere in the font directory. The font I want to use is Latha
But, I don't know how to use it in _vimrc File. set guifontwide=latha:h12
or set guifontwide=Latha:h12
doesn't work.
If I successfully set the guifontwide
to latha
, then my problem will be solved, How to do it?
Solution 1:
Did you try
:set encoding=utf-8
:set fileencoding=utf-8
?
Solution 2:
Try to reload the document using:
:e! ++enc=utf8
If that works you should maybe change the fileencodings
settings in your .vimrc.