7

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.

3 Answers 3

12

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:

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.

0

If I do ":lang sv_SE.UTF-8" then the messages show up correctly for me, but this is under Linux and I'm not sure if that will work in Windows.

1
  • When I try that I get: 'E197: Can not set the language to "sv_SE.UTF-8"'
    – Tobbe
    Nov 5, 2010 at 5:39
0

To make ÅÄÖ åäö work in vim, you need to set your Terminal client like PUTTY to use UTF-8.

This has nothing to do with vim or .vimrc

1
  • 2
    it's been talking about the gui version of vim. This has nothing to do with the terminal Aug 21, 2015 at 11:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .