gVim utf-8 in windows

When I open gVim it's localized to Sweidish, which is fine. But warning/error messages that have Swedish characters in them don't display correctly. When trying to delete a buffer with unsaved changes for example I get this:

E89: Ingen skrivning sedan senaste <e4>ndring f<f6>r buffert 1 (l<e4>gg till ! f<f6>r att tvinga)

Which roughly translates to

E89: No write since last edit for buffer 1 (append ! to force)

What I want is this:

E89: Ingen skrivning sedan senaste ändring för buffert 1 (lägg till ! för att tvinga)

These are a couple of relevant settings:

> :language
  Aktuellt spr<e5>k: "LC_COLLATE=Swedish_Sweden.1252;LC_CTYPE=C;LC_MONETARY=Swedish_Sweden.1252;LC_NUMERIC=C;LC_TIME=Swedish_Sweden.1252"
> :lang mes
  Aktuellt message spr<e5>k: "SV"
> :set enc
  encoding=utf-8

How do I make vim display the proper characters (å, ä, ö) instead of the <e5>, <e4>, <f6> codes?

EDIT: Trying :language sv_SE.UTF-8" I get E197: Can not set the language to "sv_SE.UTF-8

EDIT2: I have tried:

:language Swedish_Sweden.10646
:language sv_SV.UTF-8
:language en
:language en_EN.UTF-8

All with the same E197 error message.


I solved it. It was actually hinted at on the vim web page. http://www.vim.org/download.php#pc

I had to get two files from the gettext project on sourcforge:

  • libiconv-1.9.1.bin.woe32.zip (for iconv.dll)
  • gettext-runtime-0.13.1.bin.woe32.zip (for intl.dll)

Extract bin/iconv.dll from the libiconv zip and bin/intl.dll from the gettext zip in to your gVim/vim folder. Rename intl.dll to libintl.dll. Overwrite any existing files.

After that it just worked for me. These are the relevant lines from my _vimrc:

if has('gui_running')
    set guifont=Courier_New:h10
endif

set encoding=utf-8

They are placed at the top of _vimrc.