Bjorn Winckler wrote:
> 2008/6/18 Tony Mechelynck <[EMAIL PROTECTED]>: > > > > On 18/06/08 12:03, bj=F6rn wrote: > >> 2008/6/18 Tony Mechelynck<[EMAIL PROTECTED]>: > >>> '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: > >> > >> Thanks for clarifying that. So now that I can't rely on strings in > >> Vim being utf-8, how do I find out which encoding they are in? (I'm > >> sorry if this is obvious, but all this locale stuff is a bit of a > >> mystery to me.) > >> > > > > Try adding the line > > > > scriptencoding latin1 > > > > near the top of the menufiles, and in any case before the first > > upper-ascii character. > > Let me clarify: I am not a script writer, instead I am writing a GUI > port for Mac OS X. Thus, I need to implement functions like > gui_mch_add_menu_item(). In this function I get passed a pointer to a > vimmenu_T struct which contains a "dname" C-string specifying the name > of a menu item. My question is: how do I find out which encoding this > C-string is in? > > (From your previous post I found out that e.g. gui_mch_draw_string() > will pass strings in the encoding specified by 'enc', thus I can look > at output_conv to determine if I need to convert the string to utf-8 > before drawing it. However, I cannot use the same method to decide if > conversion is necessary for the titles of menu items.) Menu functions don't deal with more than one encoding. The Vim script is written in a certain encoding. It must either match the value of 'encoding' or specify the encoding actually used with the :scriptencoding command. Thus in all the gui_*.c functions you can safely assume that all menu text is in 'encoding'. -- George: "I just got a new set of golf clubs for my wife!" John: "Great trade!" /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ download, build and distribute -- http://www.A-A-P.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org /// --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
