Issues with Gtk2 dialogs and UTF8 data.


I have a small bit of code that reads data in from a file and displays
it in a Gtk2::Label. Strangely, any unicode data in the source code I
try appending to the read in file gets displayed fine, but anything
simply read in gets garbled. For example, 'Ã' turns into 'ÄÂ'.

I've tried various combinations of utf8::encode(), utf8::decode(),
utf8::upgrade(), and utf8::download(), as well as Encode's
utf8_encode() and utf8_decode(). Unfortunately none of these seem to

I know the data is valid unicode because unix's file(1),
utf8::is_utf8(), utf8::valid(), and simply printing out the text to
the terminal from the program confirm the validity of the data. Ergo,
I'm fairly confident the problem lies somewhere with Gtk2, but I'm not
sure what to do to work around it.

Any help is welcome, thanks,
Samuel Baldwin -

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