Displaying Chinese UTF-8 characters in gvim on Windows

Tuesday, April 2, 2013


By default, gvim on my Windows machines just displays question marks, boxes, or garbled characters when I try to open files with Chinese text. The fix was rather simple:

  1. From the gettext project on SourceForge, get libiconv-1.9.1.bin.woe32.zip, which contains bin/iconv.dll. Put that file into gvim's installation directory (for me, it's C:\Program Files (x86)\Vim\vim73).
  2. Put this into vimrc:
    set encoding=utf8
    set guifontwide=NSimSun

Note: I'm using gvim 7.3.46 from the official site.

Credit goes to user Tobbe for this answer on superuser.com, which pointed out the key ingredient (iconv.dll).

Tags: vim, unicode, chinese | Posted at 11:31 | Comments (6)


Comments

gaofeng on Saturday, January 25, 2014 at 22:42

Thank you very much for sharing this info.

hugo_dc on Tuesday, April 8, 2014 at 19:39

谢谢!, works great! :D

zekun on Wednesday, July 29, 2015 at 02:25

Thanks, that works very well ! But I can't understand the point in the answer on superuser.com. Why this iconv.dll can work well to this problem?

ewdudley on Thursday, September 24, 2015 at 10:38

Thank you.

nick on Sunday, October 15, 2017 at 02:55

thanks for the info . It works for me as well

Ben on Monday, April 1, 2019 at 09:07

Of all the choices on internet, this one rocks!

Add a comment

Name:
Email: (optional, not displayed to public)
URL: (do not fill this in — leave blank!)

Comment: