Re: libglade - "not proper UTF-8" warning



"Dr. Simon J. Melhuish" <simon melhuish net> writes: 
Thanks for that. 

OK, I see what is causing it now. I have two labels that contain a
degree symbol (radio buttons for Celcius or Fahrenheit). Is there an
easy way I can get the desired label, such that it will look OK under
varying locale settings? Presumably my label might come out funny when a
alphabet other than Latin is set if I just update it at run time.


With the upcoming GTK 2.0, what you'd do is simply encode the degree
symbol in UTF-8. With 1.2, since Glade saves a UTF-8 output file, it
should probably go ahead and convert from the locale's encoding to
UTF-8 on save, and libglade should convert back to the locale's
encoding on load. This could probably be considered a Glade bug, you
might ask on the Glade list about it.

Leaving Glade aside, what you would typically do in GTK 1.2 is
probably to put a string valid in the C locale in your source code,
and then use gettext() to let translators translate it into other
locales, using the proper encoding for that locale.

In 2.0, the encoding is UTF-8 regardless of locale, so you'd just
encode the degree symbol in UTF-8.

Havoc




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