Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

How do I fix junk characters issue in Perlapp'ed script?

by ZJ.Mike.2009 (Scribe)
on Feb 03, 2010 at 04:29 UTC ( [id://821079]=perlquestion: print w/replies, xml ) Need Help??

ZJ.Mike.2009 has asked for the wisdom of the Perl Monks concerning the following question:

Greetings, Perl Monks

I have recently converted a simple Perl script to an excutable using PerlApp 8.1. The script basically has one textfield for input and another for output. It works fine under Perl interpreter but I'm having an unexpected problem with the packaged excutable.

It is this: when I input the Enlish words in the textfiled, no problem with the output at all. But when I try some Chinese characters (encoded in GB2312 by default under my Windows XP Chinese version), something weird happens. It seems to be okay with only one chinese character but with more than one, there will be junk characters. For example, if I input Chinese characters "好人"(literally "good guy"), the output becomes "好"(first character okay but the second becomes meaningless). It looks like that something is truncated somehow by PerlApp. Any ideas on how I can fix this problem? Thanks in advance

Following is a simplified version to demonstrate the problem.

Thanks again

use Win32::GUI; $mw = new Win32::GUI::DialogBox( -text => 'Test', -left => 300, -top => 100, -left => 60, -width => 200, -height => 200, ); $mw->Show(); $text = $mw->AddTextfield( -left => 0, -top => 10, -size => [150,25], ); $result = $mw->AddTextfield( -left => 0, -top => 40, -size => [180,100], ); $button = $mw->AddButton( -name => 'button', -text => 'Go', -left => 160, -top => 10, -visible =>1, -default => 1, -ok => 1, ); $text->SetFocus(); Win32::GUI::Dialog; sub button_Click { $line = $text->GetLine(1); $result->Append($line); }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://821079]
Approved by AnomalousMonk
Front-paged by ikegami
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (3)
As of 2024-04-25 02:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found