Re: Gtk::Label::set_text() doesn't grok international characters?



On Mon, 28 May 2001 19:45:52 +0400, Pavel Rousnak said:
I've just stumbled upon a very strange thing... if $lbl is a
 > Gtk::label, and I tell it to $lbl->set_text("child"), it works
 > great, but if I tell it to $lbl->set_text("ni?o), it doesn't
 > change $lbl's text. Same goes for $lbl->set(). Am I missing
 > something here?
 Gtk converts text to wide char representation when tries to draw it.
 If the conversion fails set_text() does nothing.
 Result of such conversion depends on the text and LANG environment variable.
 Examine the X locale database (normally resides in /usr/X11R6/lib/X11/locale)
 and read man charsets for more info.

Thanks, Pavel, that's exactly the problem. I have LANG="C", and
changing LANG to "es_AR" did the trick.

I do think that this is a bug, not a feature, though. I happen
to like LANG="C". My native language is spanish, but when it
comes to working on the computer I prefer english, thank you.
LANG should affect the way the program displays its own stuff,
not the data it handles. I found out about this using Pronto, a
great Perl::Gtk mail user agent. I receive mail in about five
different languages. Am I supposed to quit my app and switch
LANG settings according to the message I intend to read? Or am I
just being stupid?

It seems X-locale 'C' supports codeset ISO8859 on your system, but 
you need ISO8859-1 (Latin-1).
There are several solutions of you problem.
1. You may set LANG=es_AR and LC_MESSAGES=C. You will have english operation
   system's messages, but 'native' another locale categories.
   man setlocale for more info.
2. You may create and install new locale using localedef command.
3. Try something like LANG=C.iso88591. This will give you C locale with
   Latin-1 codeset.
   Look for appropriate LANG in X locale database
   (/usr/X11R6/lib/X11/locale/locale.*) if LANG=C.iso88591 is not installed 
   on you computer.

I'm not familiar with Pronto: it may allow to select font manually
or do it automatically depending on content-type of a letter. 

Is this a Perl::Gtk issue, or is it plain Gtk? 
 Xlib & libc






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