Re: GTK on Linux and UTF-8 text



> On Tue, May 04, 2010 at 02:01:45PM +0200, Andreas Falkenhahn wrote:
>> I previously worked with GTK only on Windows and the Windows builds of
>> GTK
>> always used UTF-8 for everything. Now I played a bit with GTK on Linux
>> and
>> noticed that it doesn't seem to handle UTF-8 correctly by default.
>> Instead, ISO 8859-1 is used (which should be my locale's default
>> charset).
>> When I pass UTF-8 text to functions like gtk_dialog_add_button(), then
>> the
>> specified strings seem to be treated as ISO-8859-1, i.e. non ASCII
>> characters appear as multiple characters instead of being resolved to
>> the
>> single character they represent according to UTF-8 decoding tables.
>>
>> Could someone tell me how I can convince GTK to use UTF-8 as the default
>> on Linux, too?
>
> Gtk+ uses UTF-8 everywhere for everything[*] so I am almost sure that
> you do not pass UTF-8 even if you think so.  Most likely your strings
> were double-encoded to UTF-8.

Oops, yes, it happened because my text editor seems to have changed the
encoding of sources from ISO 8859-1 to UTF-8. So it really was a double
encoding :)

Thanks,

Andreas


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