gVim utf-8 in windows

8,823

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.

Share:
8,823

Related videos on Youtube

Tobbe
Author by

Tobbe

Motorcycle riding software developer SOreadytohelp

Updated on September 17, 2022

Comments

  • Tobbe
    Tobbe over 1 year

    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.

  • Tobbe
    Tobbe over 13 years
    When I try that I get: 'E197: Can not set the language to "sv_SE.UTF-8"'
  • Christian Brabandt
    Christian Brabandt over 8 years
    it's been talking about the gui version of vim. This has nothing to do with the terminal