Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

using win32::guitest in non english OS

by cstar (Initiate)
on Jan 04, 2013 at 07:31 UTC ( #1011573=perlquestion: print w/ replies, xml ) Need Help??
cstar has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I want to use Win32::Guitest in non english languages(say chinese) where window titles appear in chinese. If i mention the window title directly in findwindow function as -->FindWindowLike(undef,"ÉTextInChinese") perl is able to find the window. But i have to read the window titles from a unicode file and then have to use it in Findwindowlike function. ie: I have a file with name titles.txt encoded in UTF8 which has the title of window in chinese. Please guide me in how to read the file and give the input to Findwindowlike function

Comment on using win32::guitest in non english OS
Re: using win32::guitest in non english OS
by Anonymous Monk on Jan 04, 2013 at 07:40 UTC

      I have some chinese text in a inputfile encoded in utf8 format. I just want to read the text from the file and keep that text in a variable for further use. But when i am trying to print the line which is read, i am getting some text in Chinese, but different from what is present in the input file. Plese guide me in how to get the exact text present in input file

      use File::BOM; use Cwd; use Encode; use Encode::Detective; use strict; use warnings; my $filename=cwd().'/saml.txt'; File::BOM::open_bom(FH, $filename, ':utf8'); my $line=<FH>; my $encoding = Encode::Detective::detect ($line); print "encoding - $encoding\n"; binmode(STDOUT, ":utf8"); print "*$line*\n";

        But when i am trying to print the line which is read, i am getting some text in Chinese, but different from what is present in the input file.

        What do you mean "getting?"

        Have you checked the bytes, how are they different?

        Try ":encoding(UTF-8)"

        see Re^2: Perl / FileFind or ...

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (14)
As of 2014-09-22 15:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (198 votes), past polls