Accented chars in menus are "Invalid" using GTK2 on Solaris

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Accented chars in menus are "Invalid" using GTK2 on Solaris

Laurent Blume
Hi all,

I've built vim 7.1b.001 on Solaris 10 & Solaris Express, using the
native GTK2 libs in each case, and Sun Studio 11 compiler.

The build works fine, make test works AFAICT, and gvim starts.

However, in my locale, fr_FR.UTF-8, I got a bunch of those messages on
console output when starting it:

(gvim:8408): Gtk-WARNING **: Invalid input string

And sure enough, in the menus, all strings that contain accented chars
are empty. The others do display French text.

For editing, it works fine with UTF-8 chars, there's no problem there.
The only issue seems to be with the menus.

Any idea about what maight be wrong? Is that a vim bug?

TIA!

Laurent

How I built it:
export PATH=/usr/bin:/usr/ccs/bin:/opt/SUNWspro/bin
./configure --prefix=/opt/vim-7.1b.001 \
   --enable-multibyte
make
make test
make install

Reply | Threaded
Open this post in threaded view
|

Re: Accented chars in menus are "Invalid" using GTK2 on Solaris

Bram Moolenaar

Laurent Blume wrote:

> I've built vim 7.1b.001 on Solaris 10 & Solaris Express, using the
> native GTK2 libs in each case, and Sun Studio 11 compiler.
>
> The build works fine, make test works AFAICT, and gvim starts.
>
> However, in my locale, fr_FR.UTF-8, I got a bunch of those messages on
> console output when starting it:
>
> (gvim:8408): Gtk-WARNING **: Invalid input string
>
> And sure enough, in the menus, all strings that contain accented chars
> are empty. The others do display French text.
>
> For editing, it works fine with UTF-8 chars, there's no problem there.
> The only issue seems to be with the menus.
>
> Any idea about what maight be wrong? Is that a vim bug?

It works fine for me.  This is on FreeBSD.

I know Solaris has its own version of msgfmt.  Perhaps you used the GNU
version?  They are not compatible.  It can be tricky to get the path right.

The menu files are in iso-8859-15, thus to get utf-8 a conversion is
required.  Perhaps your gettext() doesn't support conversion?

--
hundred-and-one symptoms of being an internet addict:
101. U can read htis w/o ny porblm and cant figur eout Y its evn listd.

 /// Bram Moolenaar -- [hidden email] -- 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    ///
Reply | Threaded
Open this post in threaded view
|

Re: Accented chars in menus are "Invalid" using GTK2 on Solaris

Laurent Blume
Hello Bram, thanks for your answer,

Bram Moolenaar a écrit :
> It works fine for me.  This is on FreeBSD.

Well, I was sure it did work for at least some others :-)
It used to work at some point for me, too, but I think I've had the
issue for some time, I don't use the menus much and didn't notice.
Version 7.0.183 already had it on S10.

> I know Solaris has its own version of msgfmt.  Perhaps you used the GNU
> version?  They are not compatible.  It can be tricky to get the path right.

With the PATH I set, Solaris' msgfmt is the only one found by configure:

$ type msgfmt
msgfmt is /usr/bin/msgfmt

GNU's version is not installed as part of Solaris. I've got it in
/opt/csw/bin/gmsgfmt.

./configure said:

checking --disable-nls argument... no
checking for msgfmt... msgfmt
checking for NLS... gettext() works
checking for bind_textdomain_codeset... yes
checking for _nl_msg_cat_cntr... no


> The menu files are in iso-8859-15, thus to get utf-8 a conversion is
> required.  Perhaps your gettext() doesn't support conversion?

I'm sure it does,and it can be used either as both Solaris and
GNU-compatible, or GNU-compatible only.

   Solaris and GNU-compatible
      #include <libintl.h>

      char *gettext(const char *msgid);

http://docs.sun.com/app/docs/doc/816-5168/6mbb3hrd5?a=view

Is there a way I can check if there's something wrong with it? I'm not
experienced with gettext() use, but I can rebuild and test anything
you'd like.

TIA!

Laurent
Reply | Threaded
Open this post in threaded view
|

Re: Accented chars in menus are "Invalid" using GTK2 on Solaris

Bram Moolenaar

Laurent Blume wrote:

> Hello Bram, thanks for your answer,
>
> Bram Moolenaar a écrit :
> > It works fine for me.  This is on FreeBSD.
>
> Well, I was sure it did work for at least some others :-)
> It used to work at some point for me, too, but I think I've had the
> issue for some time, I don't use the menus much and didn't notice.
> Version 7.0.183 already had it on S10.
>
> > I know Solaris has its own version of msgfmt.  Perhaps you used the GNU
> > version?  They are not compatible.  It can be tricky to get the path right.
>
> With the PATH I set, Solaris' msgfmt is the only one found by configure:
>
> $ type msgfmt
> msgfmt is /usr/bin/msgfmt
>
> GNU's version is not installed as part of Solaris. I've got it in
> /opt/csw/bin/gmsgfmt.
>
> ./configure said:
>
> checking --disable-nls argument... no
> checking for msgfmt... msgfmt
> checking for NLS... gettext() works
> checking for bind_textdomain_codeset... yes
> checking for _nl_msg_cat_cntr... no
>
>
> > The menu files are in iso-8859-15, thus to get utf-8 a conversion is
> > required.  Perhaps your gettext() doesn't support conversion?
>
> I'm sure it does,and it can be used either as both Solaris and
> GNU-compatible, or GNU-compatible only.
>
>    Solaris and GNU-compatible
>       #include <libintl.h>
>
>       char *gettext(const char *msgid);
>
> http://docs.sun.com/app/docs/doc/816-5168/6mbb3hrd5?a=view
>
> Is there a way I can check if there's something wrong with it? I'm not
> experienced with gettext() use, but I can rebuild and test anything
> you'd like.

Sorry for leading you in the wrong direction: the menus are not
processed by gettext().  Only the messages are.

The menu file used is $VIMRUNTIME/lang/menu_fr_fr.latin1.vim.  When
'encoding' is "utf-8" then it will use "scriptencoding latin1", which
will trigger conversion from latin1 to utf-8.

The ":menu File" output should be correct.  If it isn't then there
already was a problem at this point.  You don't set 'encoding' anywhere,
hopefully.  If you change 'encoding' after loading the menus then things
will fail.  Try: ":verbose set encoding?".

--
hundred-and-one symptoms of being an internet addict:
107. When using your phone you forget that you don't have to use your
     keyboard.

 /// Bram Moolenaar -- [hidden email] -- 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    ///
Reply | Threaded
Open this post in threaded view
|

Re: Accented chars in menus are "Invalid" using GTK2 on Solaris

Laurent Blume
Bram Moolenaar a écrit :
[snip]
> The ":menu File" output should be correct.  If it isn't then there
> already was a problem at this point.  You don't set 'encoding' anywhere,
> hopefully.  If you change 'encoding' after loading the menus then things
> will fail.  Try: ":verbose set encoding?".

Yes, that's it. I added the set encoding=utf-8 and set
fileencoding=utf-8 at the bottom of .vimrc some time ago, and since I
didn't notice immediately the change in the menus, I didn't make the
relation.
Obviously, it should have been at the top: it now works fine.
My apologies for bothering you with that, and thank you very much for
your help. I'll continue beta-testing happily!

Laurent