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


In reply to Perl2Exe converting my scripts to Japanese by blackadder

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.