1 2 3 4 5 6 7 8 9 10 11 12
| use Tk; use utf8; use strict; use Encode;
my $str = encode('utf8', "世界"); my ($mw, $test_string, $txt); $mw = MainWindow->new(-title => "UTF-8 Test", -width=>400, -height=>30+0); $test_string = 'This is a sample Chinese character: ' . chr(25105) . decode('utf8', $str); $txt = $mw->Text(-height=>5)->pack; $txt->insert('end', $test_string); MainLoop;
|