glade localization woes



Hello

In the app I'm programming, with localization support, we use libglade. For a while now we've been plagued by a gettext problem in which some messages would appear with garbage in place of accented letters.

Today we finally traced the problem down.

Glade requires the program's to set it's locale to *.UTF-8 otherwise it'll spew all kinds of garbage. However, when a widget's label is set from the program (not via glade) it will produce the erroneous output I described previously.

I'm posting this here because we've worked on Gtk2 programs written in C and Python and only those written in Perl show this behaviour, so I think it might be a gtk-perl bug.

A temporary solution is to use Unicode::MapUTF8 to convert localized strings back to ISO-8859-1 before using them in Gtk widgets, but that's ugly and cumbersome:

my $dlg = Gtk2::MessageDialog->new (undef, "destroy-with-parent", "info", "close", from_utf8 ({ -string => gettext ($msg), -charset => 'ISO-8859-1'}));

Is it anything I'm doing wrong, or is it a Perl Glade bug (which is what I'm inclined to believe)?

Thanks in advance,

Cristovao.

P.S. the default locale we use here is pt_BR.ISO-8859-1.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]