How to display chinese character

Now, I am using gtk2-perl for windows to develop some program. But I can not
display chinese character in my program. The following is a testing program,
If I change the  red character to chinese character, it can not display
correctly, who can tell me why?

#!/usr/bin/perl -w

use strict;

use encoding 'gb2312';
use Gtk2 '-init';

use constant TRUE => 1;
use constant FALSE => 0;

my $window = Gtk2::Window->new;
$window->set_title ("Testing");
$window->signal_connect (destroy => sub { Gtk2->main_quit; });

my $vbox = Gtk2::VBox->new(FALSE, 6);

my $frame = Gtk2::Frame->new("Gtk2-Perl Sample");
$vbox->pack_start($frame, TRUE, TRUE, 0);

my $hbox = Gtk2::HBox->new(FALSE, 6);

my $inc_button = Gtk2::Button->new('Press');
$hbox->pack_start($inc_button, FALSE, FALSE, 0);
my $count = 1;

my $quit_button = Gtk2::Button->new('Exit');
$hbox->pack_start($quit_button, FALSE, FALSE, 0);
$quit_button->signal_connect( clicked => sub {

my $label = Gtk2::Label->new('Press 0 times.');
$vbox->pack_start($label, TRUE, TRUE, 0);

# has to be done after we've created the label so we can get to it
$inc_button->signal_connect( clicked => sub {
$label->set_text("Press $count times");


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