Re: Menu translation & wrong encoding in Windows 7
- View SourceOn Thu, Dec 31, 2009 at 05:36, Tony Mechelynck wrote:
> On 02/12/09 12:18, Mojca Miklavec wrote:No problem.
>> On Wed, Dec 2, 2009 at 10:19, Mojca Miklavec wrote:
>>> I have submitted Slovenian Vim menu translation a while ago while I
>>> was still using XP (and then didn't use Windows for ages; menu
>>> translations don't work with Aqua Vim at all) and the encoding worked
>>> Now I tried it on Windows 7 and discovered that the language is set to
>>> Slovenian_Slovenia.1250. That might be a bit weird. The native
>>> encoding used to be cp1250 indeed (at least in XP), but it could be
>>> that Windows 7 now
>>> tries to use utf-8 whenever possible ... but I don't really know.
>> I'm sorry for overflooding the mailing list. I have now figured out
>> that I should be able to change the language with
>> gvim --cmd "lang Slovenian_Slovenia.65001"
>> where 65001 is the windows code for UTF-8. This still means that
>> "system-wide encoding for applications that are not UTF-8 aware" is
>> cp1250 though. Just gvim is taught to use 65001 encoding. I copied the
>> file menu_sl_si.utf-8.vim to menu_slovenian_slovenia.65001.vim if I
>> wanted to be able to set that encoding at all, but gvim nevertheless
>> seem to send cp1250-encoded data to Windows while windows interprets
>> that data as if it was proper UTF-8.
>> This seems like a "buglet" burried deep down in the source code. I
>> wonder that no Czeck/Slovak/Polish users have complained so far.
>> PS: possibly related problem that I had in past (sorry, I don't know
>> where the offcial archive is):
>> Subject: vim + win + utf-8 => I'm lost
>> Date: Aug 4, 2005 5:23:05 pm
> Hello Mojca,
> I'm sorry no one answered your posts in almost one month (or only by
> breaking the thread).
> To see which locale the OS passes to Vim, load it asCurrent language:
> gvim -N -u NONE
> and then type
> This will show you all parts of the locale: LC_MESSAGES for menus & messages
> translations, LC_CTYPE for character encoding, LC_TIME for timestamp format,
> and a bunch of others which I don't think Vim uses. (These are Unix-like
> names but I remember from my years on XP that they're also used in Vim for
The problem is that, contrary to probably every single UNIX-like
machine, the encoding here doesn't mean "this is the encoding used by
the system", but rather "this is the encoding that programs that don't
support UTF-8 should be using". At least that's true for Windows 7 and
most probably Vista as well. I don't know for sure about XP.
> Windows codepage 1250 is a "Central European" encoding which is OK forEvery single operating system has its own specifics. I wouldn't dare
> formerly Czechoslovak countries and for those formerly Yugoslav countries
> which use the Latin alphabet; but of course Vim and the OS must agree on
> which encoding is to be used to transmit keystrokes from the keyboard to Vim
> and, in console Vim, from Vim to the screen. (gvim displays its text on its
> own graphical screen without passing _text_ to the OS for displaying.)
> Yes, if 65001 is the Windows name for UTF-8, then you could indeed copy the
> menu (and helpfiles) with names ending in .utf-8 or .utf-8.vim etc. to files
> of the same name with the .utf8 replaced by .65001 (Why can't Windows use
> sl_SI.UTF-8 like Unix does? I suppose Bill Gate$$$ wants to keep his users
> captive and prevent them for escaping to Unix/Linux. Oh well...)
to say it that way - windows developers would complain that unix and
mac are weird and vice versa. Windows version simply needs some
special care and so does Mac version (that doesn't even allow menu
translations at the moment which is really a pitty).
My very honest opinion is that gvim works *BEST* on Windows. I know
that's a kind of paradox, but to my taste it really has the nicest
user interface (including automatic support for ctrl+c/x/v/s, very
smooth mouse interactions etc.).
> Beware though that any file in the $VIMRUNTIME tree can be modified orMy intention is not to fix my own copy of Vim (I switched to a
> erased without warning any time you upgrade Vim and/or its runtime files, so
> when release 7.3 (or, who knows?, 8.0) gets published, be sure to copy your
> files again.
different OS anyway), but to make it work by default for every
"Central European" (or Slovenian) user. This means that if I was to
make any change, I would request to fix it upstream, rather than
fixing it on my computer only.
> On Linux you could set upThere are plenty of examples in $VIMRUNTIME that don't require
> $VIM/vimfiles/menu_slovenian_slovenia.65001.vim as a soft link to
> ../latest/menu_sl_si.utf-8.vim with $VIM/latest as a soft link to the
> current $VIMRUNTIME but of course AFAIK soft links are foreign to Windows so
> I suppose you'll have to resort to copying.
copying, but rather
> Or else, you could set 'encoding' to UTF-8 if it isn't already, beforeI'll test it. My problem has been solved by playing with encoding
> loading or reloading the menus. Maybe the following (untested) could work,
> at the very top of your vimrc, and regardless of the OS locale:
settings (a file that worked in XP stopped working in Windows 7). The
default settings work fine, but use cp1250 even though Windows 7
should be able to work with UTF-8 natively. In my opinion it would be
much better to use UTF-8 (Unicode) by default in newer Windows
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php