Re: Issues with Gtk2 dialogs and UTF8 data.



Hello.

I'm almost sure your troubles are not GTK+ related. You'll find some
test code below that works fine for me (just put some UTF-8 encoded
text into sample.txt file).

==== Code ====
#!/usr/bin/env perl

use strict;
use warnings;
use Glib qw(TRUE FALSE);
use Gtk2;

Gtk2->init();

my $window = Gtk2::Window->new ('toplevel');
$window->signal_connect (delete_event => sub { Gtk2->main_quit(); });
$window->set_border_width (10);

my $input;
open $input, '<', 'sample.txt';
binmode $input, ':utf8';

my $label = Gtk2::Label->new (<$input>);
$window->add ($label);
$window->show_all();

Gtk2->main();
==== /Code ====


BTW, talking about "unicode data" is not really helpful. In most
cases, this means "xxx-encoded text", where xxx is one of the UTF-8,
UTF-16le, UTF-16be ..., and you should state this explicitly.

Cheers,
Tadej

-- 
Tadej BorovÅak
tadeboro.blogspot.com
tadeboro gmail com
tadej borovsak gmail com



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