Vim 7.4 binary for Windows, can't process Thai characters. No multi_byte, has multi_byte_ime/dyn instead?

StackOverflow https://stackoverflow.com/questions/22917995

Question


Like at least one other Vim / gVim 7.4 for Windows user, I'm going 'round and 'round in circles trying to get gVim to properly display Unicode. In my case, I have a .py file that contains Thai characters. For example, เมษายน.

  • If in Windows 7 64-bit, I open the file in gVim 7.4, depending on which options I'm experimenting with, I get either rectangles or "line noise".

  • If in Windows, I open the file in Notepad++ or jEdit or the Eclipse PyDev editor, the Thai characters are correctly presented. Fast, simple.

  • If in Windows, I open the file in Geany 1.23.1 or Bluefish 2.2.5 for Windows, I get some nifty boxes, one per Thai character, all of which begin with x0E then a one-byte hex character code.

  • If in gVim 7.4 running under Mint Linux, I open the file the Thai characters are correctly displayed.

My first thought was that in my Windows gVim instance, I merely need to duplicate the fileencodings settings from my Linux gVim instance, ala fileencodings=ucs-bom,utf-8,default,latin1. I also duplicated the Linux instance's termencoding=utf-8.

All that accomplished was that the Thai characters were displayed as a random string of "line noise" rather than, say, one empty box per Thai character.

As confirmed by posts by several gVim 7.4 for Windows users, in gVim 7.4 the :version command lists multi_byte_ime/dyn but NOT multi_byte. See, inter alia:

Have Vim fully support UTF-8 on Windows

This differs from the gVim 7.4 instance running in Linux where :version DOES list multi_byte but does NOT include multi_byte_ime/dyn.

Evidently multi_byte_ime is about input method whereas multi_byte seems to be about supporting multi-byte characters(?) Whatever the significance of the two different ":version" outputs, I simply can't get gVim 7.4 for Windows to display the Thai characters whereas gVim 7.4 in Mint Linux does it straightaway.

At this point I'm trying to figure out a way forward. I've gone 'round and 'round and 'round reading different forums and experimenting with various options that purport to enable gVim 7.4 for Windows to display the Thai characters. So far I've gotten nowhere.

Was it helpful?

Solution

Unpack iconv.dll and libintl.dll from the links provided on the vim download page, under iconv library and newer intl library and install them as directed on the aforementioned vim download page.

Update:

You will need to get iconv.dll from the win32 build of iconv. and intl.dll from the win32 build of gettext. You can access the files for both from SourceForge.

First, follow the libiconv-win32 on the SourceForge page. Click on the latest version 1.9.1 as of the date of this answer. Click on that and download the zipfile. (Currently libiconv-1.9.1.bin.woe32.zip). The zipfile contains the file iconv.dll in the bin subdirectory. Put iconv.dll in the same directory as gvim.exe.

Next follow the gettext-win32 link on Sourceforge page linked above. Click on the latest version (0.13.1 as of the date of this answer) and download the runtime zipfile (currently gettext-runtime-0.13.1.bin.woe32.zip). This zipfile contains the file intl.dll in the bin subdirectory. Copy that in the same directory as gvim.exe, renaming it as libintl.dll. This might overwrite a file that is already there.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top