On Tue, 29 Jul 2003 09:22:23 +0800
James Henstridge <[EMAIL PROTECTED]> wrote:
> >When I call from Python glade.XML("mygladefile", domain="mydomain")
> >wrapper code does not use domain, instead passes it into libglade2 by
> >calling glade_xml_new. And then libglade2 uses "mydomain" internally.
> >But, AFAIU gtk requires that all strings are in UTF-8 encoding.
> >Therefore libglade2 should contain call to
> >bind_textdomain_codeset(domain, "UTF-8"). But it does not. And, of
> >course, strings are extracted not in UTF-8 but in system encoding and
> >I have error messages like "Bad UTF-8 string". There is no problem
> >when I use libglade from C - I just put call to
> >bind_textdomain_codeset in my own code. But Python AFAIK does not use
> >libgettext. Instead it works with .mo files directly. So I can't
> >invoke bind_textdomain_codeset from Python.
> >
> >I've solved this problem for me by patching libglade2 - I've just
> >added call to bind_textdomain_codeset and all works OK. But I'm not
> >sure that this is right solution. Why such call is absent even in
> >fresh version of libglade2 - 2.0.1 ? I don't believe that nobody use
> >such tool combination before me. Maybe I misunderstand something?
> Does calling gtk.glade.bindtextdomain("mydomain",
> "/path/to/locale/dir") help? This should set up the translation
> domain with the C level gettext library that libglade uses. It will
> also set the translation domain to return UTF-8 strings like GTK
> needs. This function is provided by the library for the benefit of
> pygtk programmers, since the functionality needed isn't exposed in the
> gettext or locale modules in Python 2.2.
Sure, it works. Thank you.
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/