vim can't display characters properly(in other languages besides english).....

706 views
Skip to first unread message

aksr

unread,
Aug 28, 2010, 1:17:08 AM8/28/10
to vim_use
windows xp sp2
latest vim (7.3)
-------
when i change the language for my keyboard(to serbian latin):

if i put ":set encoding=latin1"
then i get this:
for chars(č,ć,š,đ,ž) i get(c,c,BS,d,BS): č-c, ć-c, š-(black square), đ-
d, ž-(black square)
..and if i put ":set encoding=utf-8"
i get, for all(čćšđž), "black squares"...
other characters are displayed properly and layout(for the keyboard,
when i change language) is fine..
in other programs for text editing(notepad, notepad++,PSPad,
UltraEdit) everything works as it should...
--
when i change the language to greek every char is displayed as
questionmark
every language is displayed bad, only english is displayed properly....
(german, greek, russian, serbian cyrilic, )
(i tried this on my PC and laptop...same (bad) result..)

John Matthewman

unread,
Aug 28, 2010, 8:43:57 AM8/28/10
to vim...@googlegroups.com
On 8/28/10, aksr <aksr...@gmail.com> wrote:
> windows xp sp2
> latest vim (7.3)
> -------
> when i change the language for my keyboard(to serbian latin):
>
> if i put ":set encoding=latin1"
> then i get this:
> for chars(č,ć,š,đ,ž) i get(c,c,BS,d,BS): č-c, ć-c, š-(black square), đ-
> d, ž-(black square)
> ..and if i put ":set encoding=utf-8"
> i get, for all(čćšđž), "black squares"...
> other characters are displayed properly and layout(for the keyboard,
> when i change language) is fine..

Aside from changing the encoding and keymap, have you changed which
font Vim is using? Last time I used Vim on a Windows box it used the
Fixedsys font (at least, I think it was Fixedsys..) by default, which
doesn't have all of the characters you need. So, for example, every
time I type in another language -- Vietnamese, which needs lots of
extra characters too -- I change the encoding to UTF-8, set the
keymap, and change the font to something better. I really like 'Droid
Sans Mono', but 'Courier New' will do in a pinch ;)

BC

unread,
Aug 28, 2010, 3:33:33 PM8/28/10
to vim_use
On Aug 28, 1:17 am, aksr <aksr.1...@gmail.com> wrote:

> in other programs for text editing(notepad, notepad++,PSPad,
> UltraEdit) everything works as it should...
> --
> when i change the language to greek every char is displayed as
> questionmark
> every language is displayed bad, only english is displayed properly....
> (german, greek, russian, serbian cyrilic, )
> (i tried this on my PC and laptop...same (bad) result..)

(I only saw John Mathewman's response just as I was hitting Send on
this, so this is a bit redundant)

I am completely perplexed by encodings myself, so I hope someone else
can give you better help, but:

Could the problem be the font? Are you using the same font in vim
that you use with the other editors? I believe some fonts support
fewer unicode characters than others.
This page might be a helpful reference:
http://www.fileformat.info/info/unicode/font/

From what I can tell, your characters look fine in Consolas and
Courrier_new, on my system. (but I'm so stumped by encodings that I
keep getting nasty "conversion error" messages no matter what I do.)
Also, after you change the encoding, are you typing in, or pasting in,
new text, or just observing what happens to the text already in the
buffer? That can produce strange results, so make sure you check with
fresh text.

Good luck

B

BC

unread,
Aug 28, 2010, 3:43:10 PM8/28/10
to vim_use

On Aug 28, 1:17 am, aksr <aksr.1...@gmail.com> wrote:
> windows xp sp2
> latest vim (7.3)
> -------
> when i change the language for my keyboard(to serbian latin):
>
> if i put ":set encoding=latin1"
> then i get this:
> for chars(č,ć,š,đ,ž) i get(c,c,BS,d,BS): č-c, ć-c, š-(black square), đ-
> d, ž-(black square)
> ..and if i put ":set encoding=utf-8"
> i get, for all(čćšđž), "black squares"...

Just realized this, as I was experimenting with the above text pasted
into my gvim:
I have to set BOTH enc=utf-8 AND fenc=utf-8 if I want to be able to
save and reopen the file without conversion errors. When they're both
the same, your characters seem fine in every font I tried. Of course,
I'm just pasting, not typing...

Tony Mechelynck

unread,
Aug 28, 2010, 6:27:39 PM8/28/10
to vim...@googlegroups.com, BC

http://vim.wikia.com/wiki/Working_with_Unicode (and the help topics
listed there) have some info about using Vim to create multilingual files.

You can't type š č ć ž đ etc. when 'encoding' is set to Latin1 because
those characters are not among the 191 printable and 65 control
characters which make up the 255-character set of Latin1. These
characters are typical of Slavic or "East European" languages while
Latin1 is a "Western" encoding which can represent most European
languages used West of the former Iron Curtain, not including Greek,
Turkish, Maltese, and I'm not sure about Inuqtitut and Basque.


Best regards,
Tony.
--
Mynd you, m00se bites Kan be pretty nasti ...
"Monty Python and the Holy Grail" PYTHON (MONTY)
PICTURES LTD

Reply all
Reply to author
Forward
0 new messages