Mojca Miklavec wrote:
On 6/12/06, A.J.Mechelynck wrote:
Mojca Miklavec wrote:
> Hello,
>
> I translated the menus for gvim and wanted to use them under windows,
> but the non-latin characters simply don't show in the menu (other
> characters are shown instead: squares š and ž and some other character
> for č).
>
> All other programs under Windows work fine, the encoding should also
> be OK (If I rename the Russian file to menu_sl_si.utf-8.vim, I only
> get question marks in menu, but I saw other cyrillic programs running
> on the same computer without any problems as well).
>
> I suspect that Vim might be asking Windows for Western European font
> for the menu. I'm not sure about it, but in any case it's a bit weird.
>
> Is there any remedy for it?
>
> Any hints would be appreciated,
> Mojca Miklavec
>
>
>
You must make sure that you have:
- an 'encoding' which includes the non-Latin characters you want to use
- (in console Vim) a terminal code page which includes them

What is that? And "console vim" if you mean the one without GUI menus
is not always there (I have it one one computer, but not on the
other).

"Console Vim" is the one without GUI. On Windows a different executable must be used, usually named vim.exe (or possibly something starting in "vim" as in vimd.exe for a debug version etc.); it displays in a Dos Box. On Unix a single executable can be used as a GUI (through X11) or as a console version (displaying on /dev/tty or on xterm, konsole, etc.) depending on how it is invoked.


- (in gvim) a 'guifont' which has the glyphs for them.

I have that (the default font is OK), but in Menu another font is used
(some default Windows font which is the same in all the applications).

Check 'encoding' and 'guifont' by means of

:verbose set encoding? guifont?

encoding=utf-8
Last set from D:\soft\_vimrc
guifont=

[some parts deleted]

'guifont' empty means some default system font, such as Fixed. IMHO it is not he prettiest but if you're satisfied with it you may stay with it.



3. check that there is a line "scriptencoding utf-8" near the top of the
file, before the first non-Latin character

It is.

4. save the file with ":saveas ++enc=utf-8
~/.vim/lang/menu_sl_si.utf-8.vim" (on Unix) or ":saveas ++enc=utf-8
~/vimfiles/lang/menu_sl_si.utf-8.vim" (on Windows) (without hte quotes
in either case).

I didn't use that, but it seems to be in UTF-8.

I guess that the problem is not related to the vim itself, but rather
to the Windows GUI, so the file might work properly on Mac or Linux.
I've seen no options to modify the menu font (I did, but I had the
impression that that works only in Linux).

There is a -menufont {font} command-line option, but from where it is described in the help I fear it is only applicable to X11 (all Unix/Linux versions and possibly some MacOsX versions). AFAIK the font used for menus in Windows is common to all applications and thus outside the reach of gvim. Try the following:

gvim -N -u NONE
:language messages
:set encoding?

This will tell you which "language" and "charset" settings are passed by Windows to gvim before any vimrc or other script changes them. If they are not compatible with what you want to display in the menus, you will need to change the "country-specific" settings before starting Windows. I think the settings are to be found in the "international keyboard" widget, probably configured under Control Panel -> Keyboard, then choose a language and keyboard layout from the system tray; but I might be wrong.

See
http://vim.sourceforge.net/tips/tip.php?tip_id=246
:help ++opt
:help :scriptencoding

Can please anybody check the attached file? It seems to me that it IS
in utf-8, but I might be wrong. I'm only sending the "Tools" menu.
Instead of "Skoči nazaj" I see "Skoèi nazaj" and instead of "Pokaži
napake" I get "Poka[]i napake", where [] stands for a box. Can anyone
get the content right?

Thanks a lot,
Mojca


I don't know the language it's in, but, when I view it in gvim, it sets 'fileencoding' to utf-8 and the contents look like some mixture of English and some Slavic-family language using Latin alphabet with diacritics (mostly c, s and z, all three with caron).

If you _see_ it as something else when you _edit_ it, then either you don't have 'encoding' and 'fileencoding' set both to "utf-8", or your 'guifont' lacks some necessary glyphs. If you see it OK when _editing_ but not in the _menus_ then see above about the Windows settings.


Best regards,
Tony.

Reply via email to