2

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.

Community
  • 1
  • 1
RBV
  • 1,367
  • 1
  • 14
  • 33

1 Answers1

0

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.

Roland Smith
  • 42,427
  • 3
  • 64
  • 94
  • Ah, thanks. However, both links point to http://sourceforge.net/projects/gettext which points to gettext-tools-0.12.bin.woe32.zip. And that ZIP file does not contain ANY DLLs. One must search for gettext-runtime-0.13.1.bin.woe32.zip to find intl.dll. For iconv.dll, one must locate libiconv-1.9.1.bin.woe32.zip. The page linked to from the Vim downloads page doesn't make that easy. Per the instructions, I then renamed my default intl.dll file to BACkUPintl.dll, copied intl.dll into my vim.exe folder, and renamed it to libintl.dll. And it still doesn't display the Thai characters. Sigh – RBV Apr 07 '14 at 23:46
  • @RBV I've expanded the answer and tried to make it more specific. Did you also add libiconv.dll? Note that you will also need to use a font that contains the characters in question. – Roland Smith Apr 12 '14 at 09:35
  • Thanks but it doesn't work. For a start gettext-tools-0.13.1.bin.woe32.zip doesn't contain intl.dll. Second, whatever the underlying problem of gVim 7.4 on Windows 7 is having displaying the Thai characters, it's a problem that's too easily solvable with other editors (a few mouse clicks and it's done), or even with gVim running on Mint Linux (no additional action required.) No need to go searching the Internet for files of changing the font. So my fix is just to user another editor in Windows. – RBV Apr 13 '14 at 21:21
  • The file intl.dll is in gettext-runtime, not gettext-tools! But you are certainly right that windows is kind of infertile ground for open-source software. Mostly because the default environment is so barren. – Roland Smith Apr 14 '14 at 19:18
  • I found my way to gettext-runtime-0.13.1.bin.woe32.zip and libiconv-1.9.1.bin.woe32.zip, acquired intl.dll and iconv.dll, then stored the two DLLs, intl.dll as libintl.dll, in the same directory as gvim.exe. Doesn't work. This was my final go 'round on this issue. Finis. – RBV Apr 15 '14 at 20:50