blackadder has asked for the wisdom of the Perl Monks concerning the following question:

Hi all

I converted my Tk based script to exe using Perl2exe successfully, however the the text on my Tk form is comming out in Japanese!!!!

Any Idea why is this please?

BTW : I've written everything in English, where did this Japanese stuff come from?

here is the code

# # # # # # use vars qw/%Data %Tk %Info/; use Tk; use Win32; use Win32::OLE qw(in with); use Win32::OLE::Const 'Microsoft Excel'; $Tk{main} = MainWindow->new (-background => 'white', -title=> 'WinBcp +Check v6.0'); $Tk{main}->geometry('400x130'); $Tk{top_frame} = $Tk{main}->Frame->pack(qw/-side top -fill x/); $Tk{source_box} = $Tk{top_frame}->Label(-text=>"Hosts : ")->pack(qw/-s +ide left -padx 10 -pady 10/); $Tk{source_entry} = $Tk{top_frame}->Entry(-width=>40, -textvariable=> +\ $Data{source})->pack(qw/-side right -fill both -padx 10 -pady 10 -e +xpand 1/); $Tk{middle_frame} = $Tk{main}->Frame->pack(qw/-side top -fill x/); $Tk{middle_box} = $Tk{middle_frame}->Label(-text=>"Path : ")->pack(qw +/-side left -padx 10 -pady 10/); $Tk{middle_entry} = $Tk{middle_frame}->Entry(-width=>40, -textvariable +=> \ $Data{path})->pack(qw/-side right -fill both -padx 10 -pady 10 - +expand 1/); $Tk{bottom_frame} = $Tk{main}->Frame->pack(qw/-side top -fill x/); $Tk{go_buttn} = $Tk{bottom_frame}->Button( -text= +>'GO!', -borde +rwidth=>5, -width +=>60, -comma +nd=>sub { + &check_process; + Win32::MsgBox("Operation has completed +successfully, Please save your xls file - be aware of save path if yo +u are using your admin account.", 0,$0); + } )->pac +k(qw/-side bottom -padx 10 -pady 10/); sub check_process { my @DB_info; $Data{analyst} = Win32::LoginName(); $Data{app_sync_dir} = 'c$\program files\common files\samanchi sysa +dmin\log\ApplicationSynchronizer'; open (LST, "$Data{source}") || &error_display($Data{source}); chomp (my @work_file=<LST>); close (LST); for (@work_file) { next if ($_ =~ /^\s*$/); my $data = {}; ($data->{bu}, $data->{group}, $data->{function}, $data->{source_id}, $data->{source_pc}, $data->{target_pc},) = split (/,/,$_); push (@DB_info, $data); } my $Excel = Win32::OLE->GetActiveObject('Excel.Application') || Wi +n32::OLE->new('Excel.Application'); print "\nStarting up Excel.....\n"; $Excel->{Visible} = 1; my $Book = $Excel->Workbooks->Add; my $Sheet1 = $Book->Worksheets(1); $Sheet1->Range ("A:F")->{ColumnWidth}=30; $Sheet1->Cells(1,1)->{value}= "Technical Support Person : ".$Data{ +analyst}; $Sheet1->Cells(2,1)->Font->{FontStyle}= 'bold'; $Sheet1->Cells(2,1)->{value}= "Target Machine"; $Sheet1->Cells(2,2)->Font->{FontStyle}= 'bold'; $Sheet1->Cells(2,2)->{value}= "Business Unit"; $Sheet1->Cells(2,3)->Font->{FontStyle}= 'bold'; $Sheet1->Cells(2,3)->{value}= "Groups"; $Sheet1->Cells(2,4)->Font->{FontStyle}= 'bold'; $Sheet1->Cells(2,4)->{value}= "Function"; $Sheet1->Cells(2,5)->Font->{FontStyle}= 'bold'; $Sheet1->Cells(2,5)->{value}= "WinBcp Status"; $Sheet1->Cells(2,6)->Font->{FontStyle}= 'bold'; $Sheet1->Cells(2,6)->{value}= "Information"; my $row = 3; my $col; for my $info (@DB_info) { $col = 1; print "\n----------------------------------------------------- +-------------------\n"; my $target_dir = "\\\\".$info->{target_pc}."\\".$Data{app_sync +_dir}; print "\n$info->{target_pc} ($info->{bu}, $info->{group}, $inf +o->{function})\n"; $Sheet1->Cells($row, $col++)->{value}= "$info->{target_pc}"; $Sheet1->Cells($row, $col++)->{value}= "$info->{bu}"; $Sheet1->Cells($row, $col++)->{value}= "$info->{group}"; $Sheet1->Cells($row, $col++)->{value}= "$info->{function}"; my $rep = `ping $info->{target_pc} -n 1`; if ($rep =~ /reply/i) { if (-e $target_dir) { print "WinBcp operation status : "; my $hist_log = $target_dir.'\History.log'; open(APPSYNC, $hist_log) || warn "\n$_ : No log file w +as found\n"; chomp(my @status = <APPSYNC>); close (APPSYNC); $status[$#status] =~ /(\w+)\s*\[BATCHMODE\](.+)\s*$/; print "$1\n$2\n"; if ($1 !~ /^\s*$/) { $Sheet1->Cells($row, $col++)->{value}= "$1"; $Sheet1->Cells($row++, $col++)->{value}= "$2"; } else { $Sheet1->Cells($row++, $col++)->{value}= 'Unknown' +; } } else { print " : No ApplicationSynchronizer folder was detect +ed.\n"; $Sheet1->Cells($row++, $col++)->{value}= 'No Applicati +onSynchronizer folder was detected'; } } else { print "\n$info->{target_pc} : PC Down\n"; $Sheet1->Cells($row++, $col++)->{value}= 'PC Down'; } } print "\n\n____________________________Completed the List_________ +___________________\n\n\n\n"; $Book->SaveAs ("$Data{path}"); } sub error_display { my (@input) = @_; Win32::MsgBox("$!\n\n@input\n",0x00000000 |0x00000010|0x00000000," +$0 : Operation Failed"); exit 1; } END { print "\n\n******************************************************* +**********\n"; print "\n\n\t\t\tScript by : Blackadder \n"; print "\n\n\t\t\tDate : September 2004 \n"; print "\n\n******************************************************* +**********\n"; } Tk::MainLoop; exit 1;

Blackadder

janitored by ybiC: Balanced <readmore> tags around longish codeblock, as per Monastery convention

Replies are listed 'Best First'.
Re: Perl2Exe converting my scripts to Japanese
by TimToady (Parson) on Sep 17, 2004 at 18:11 UTC
    I must confess, I was rather disappointed by this article after having my hopes raised by the title. I had expectations of seeing what Perl scripts would look like after having been converted to Japanese. You know, like instead of saying
    print @foo;
    it would say something like
    @ふは書いて下さい。
    Oh, well... ^_^
Re: Perl2Exe converting my scripts to Japanese
by Courage (Parson) on Sep 16, 2004 at 14:23 UTC
    do you mind providing screenshot?
      I wish I could, How can I provide a screen shot? hitting the print screen and then pasting didn't work!!Anyway all the text in my Tk::MainWindow that was ment to come out in English came out in some oriental language. Chinese, Japanese or something like that!!!

      I am using perl version 5.8.4, and downloaded latest Perl2exe v8.04

      I just found this from the P2Exe documentation
      5. Perl2exe compatibility Perl2Exe V7.01 for Win32 is compatible with Perl 5.8.0, Perl 5.6 Perl +5.005. Perl2Exe V7.01 for Unix is compatible with Perl 5.8.0. Perl2Exe V5.xx for Win32 is compatible with Perl 5.6 and Perl 5.005. Perl2Exe V5.xx for Unix is compatible with Perl 5.6. Perl2Exe for Perl 5.6 is compatible with IndigoPerl 5.6 from www.indig +ostar.com and ActivePerl 5.6 from www.activestate.com . Perl2Exe for Perl 5.005 is compatible with ActiveState's build 522 and + other 5xx builds. Perl2Exe for Perl 5.004 is compatible with "Perl 5.004_02" from CPAN, +which is also called the standard build. Perl2Exe for Perl 5.003 is compatible with "Perl, version 5.003_07, Pe +rl for Win32 Build 316". Perl2Exe V1.xx for Unix is compatible with Perl 5.00503.
      I can't see Perl version 8.5.4 in the list maybe that's why???

      I will downgrade my perl and check again, because this never happened to me before!!!

      I thank you

      No, no, no, I found this on Indigo's web site,...himmmmm, Back to sqr 1.
      Download Perl2Exe for Win32 V8.40 Supports Perl 5.8.4, Perl 5.8.3, Perl 5.6.1 and Perl 5.005 Perl2Exe V8.40 for Win32 (Jun 29 2004)
      Blackadder
        probably you deal with some encoding problem, and it could be discovered what a encoding problem by seeing a screenshot.

        do you have some web place where you could put it, and make link from there?
        You can temporarily place it on your scratchpasd or even on your user's page?

        If not, you can e-mail it to me to perlmonk@vkonovalov.ru

        While I have few preliminary ideas about what went wrong, it is better to see y screenshot first.

        Best regards.

Re: Perl2Exe converting my scripts to Japanese
by Anonymous Monk on Sep 17, 2004 at 03:53 UTC
    maybe try support http://www.indigostar.com/ordperl.htm