Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with AddTextfield() and utf8 in Win32::Gui

Status
Not open for further replies.

mohsenalizadeh

Programmer
Mar 17, 2010
5
IR
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::Dialog();
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 believe you're running into limitations of Windows and not Perl here. It may be best to ask in a Windows programming forum whether the standard GUI controls like Textfield actually support UTF-8.

The character set of the DOS window (on my system anyway) where you are printing the value of $nn to does not support those characters, so it's difficult to verify what input it is actually getting.

I tried to see if I could install Persian as an input language in Windows but it wasn't available in the list of choices. Does it also have another name?

Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top