mohsenalizadeh
Programmer
Hi
I Write a Script with Win32::Gui. I have problem for read from AddTextfield() with UTF8 character.
#!C:/strawberry/perl/bin/perl.exe
use strict;
use warnings;
use Encode;
use utf8;
use Win32::API ();
use Win32::GUI();
my $main = Win32::GUI::Window->new(
-width => 300,
-height => 170,
-left => 200,
-top => 100,
-minsize => [300,170],
-maxsize => [300,170],
-dialogui =>1,
);
$main->AddTextfield(
-name => 'nametextfield',
-pos=>[50,50],
-size => [ 140, 25 ],
-align => 'right',
-tabstop => 1,
);
my $savelabel = $main->AddButton(
-name => 'save',
-text =>'click me',
-pos => [50,100],
-tabstop => 1,
);
print $main->nametextfield->Text;
$main->Show();
Win32::GUI:ialog();
sub Main_Terminate {
return -1;
}
sub save_Click{
my $nn = $main->nametextfield->Text();
print $nn;
}
When I type ???? in Textfield , Instead Of ???? , this charachter printed ãÍãÏ). how encode or docode ?
I test this syntax , but not working :
my $nn = decode('utf8',$main->nametextfield->Text);
please help me.
thankyou
I Write a Script with Win32::Gui. I have problem for read from AddTextfield() with UTF8 character.
#!C:/strawberry/perl/bin/perl.exe
use strict;
use warnings;
use Encode;
use utf8;
use Win32::API ();
use Win32::GUI();
my $main = Win32::GUI::Window->new(
-width => 300,
-height => 170,
-left => 200,
-top => 100,
-minsize => [300,170],
-maxsize => [300,170],
-dialogui =>1,
);
$main->AddTextfield(
-name => 'nametextfield',
-pos=>[50,50],
-size => [ 140, 25 ],
-align => 'right',
-tabstop => 1,
);
my $savelabel = $main->AddButton(
-name => 'save',
-text =>'click me',
-pos => [50,100],
-tabstop => 1,
);
print $main->nametextfield->Text;
$main->Show();
Win32::GUI:ialog();
sub Main_Terminate {
return -1;
}
sub save_Click{
my $nn = $main->nametextfield->Text();
print $nn;
}
When I type ???? in Textfield , Instead Of ???? , this charachter printed ãÍãÏ). how encode or docode ?
I test this syntax , but not working :
my $nn = decode('utf8',$main->nametextfield->Text);
please help me.
thankyou