On 18/06/08 11:13, björn wrote:
> Hi,
>
> A user reported problems using the HTML plugin
> (http://www.vim.org/scripts/script.php?script_id=453) with MacVim on
> the vim_mac list. I looked into this problem and found out that it
> was caused by the fact that menus in this plugin are defined in a file
> whose filetype is latin-1 but some characters in the menus have their
> 8th bit set. In MacVim "enc" is set to utf-8 by default, but these
> menu items do not get converted to utf-8, instead they stay latin-1
> with the 8th bit set. MacVim internally uses utf-8 (tenc is forced to
> utf-8 like the GTK port), so when this invalid utf-8 text reaches
> MacVim it causes problems.
>
> The question now is: why doesn't Vim convert the menu titles to valid
> utf-8? Isn't "enc=utf-8" supposed to ensure that all text is
> internally represented as utf-8?
>
> Note that MacVim converts all incoming text to utf-8 using the
> CONVERT_TO_UTF8() macro, but in this case this macro does nothing as
> Vim already seems to think the text is in utf-8 format.
>
> Björn
'encoding' set to UTF-8 means the contents of _files being edited_ are
represented internally as UTF-8. IIUC, the menu locale is defined by
":language messages" at the time the menu script is sourced: for
instance, to make sure menus are in English, include
if has('unix')
lang mess C
else
lang mess en
endif
before you issue ":filetype plugin on" (either explicitly, or implicitly
by sourcing the vimrc_example.vim).
I remember a problem some time ago with some locales, where the menus
always came out wrong in various ways depending of the sequence of
":language messages zh_CN.GB18030", ":filetype plugin on" and ":set
enc=utf-8". I think the problem was solved but I'm not 100% sure -- you
might want to check http://ftp.vim.org/pub/vim/patches/7.1/README
Best regards,
Tony.
--
hundred-and-one symptoms of being an internet addict:
11. You find yourself typing "com" after every period when using a word
processor.com
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---