Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^4: using win32::guitest in non english OS

by cstar (Initiate)
on Jan 04, 2013 at 11:05 UTC ( #1011610=note: print w/ replies, xml ) Need Help??


in reply to Re^3: using win32::guitest in non english OS
in thread using win32::guitest in non english OS

I will explain my problem with below 2 scripts

Script 1:

use Encode; use Win32::GuiTest qw(FindWindowLike); open(MYFILE, '<:encoding(UTF-8)',"saml.txt") || die "cannot open: $!" +; open(OUTFILE,'>:encoding(UTF-8)',"out.txt") || die "cannot open: $!"; $line=<MYFILE>; #reading the chinese text from input file chomp($line); binmode(STDOUT, ":utf8"); print "$line\n"; #===> Here perl prints out some chinese text to the +command console, but different from what is given in input file my @hwnd=Win32::GuiTest::FindWindowLike(undef,$line); if($hwnd[0]) { print "window found\n"; } else { print "window not found\n"; } print OUTFILE $line; #==> Here perl prints out same chinese text as i +nput to the outfile

Script 2

use Encode; use Win32::GuiTest qw(FindWindowLike); $line="***Winow title in chinese**"; binmode(STDOUT, ":utf8"); print "$line\n"; #===> Here perl prints out some chinese text to the +command console, but different from what is given in input file my @hwnd=Win32::GuiTest::FindWindowLike(undef,$line); if($hwnd[0]) { print "window found\n"; } else { print "window not found\n"; }

Script 1 gives me the output as "window not found" (though window is present)as the window title is read from the input text file. Script 2 gives me the proper output as window found, as the window title is hardcoded in the string.

What am i doing wrong in script 1 while reading from unicode file.


Comment on Re^4: using win32::guitest in non english OS
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1011610]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (9)
As of 2015-07-03 13:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (53 votes), past polls