Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

using win32::guitest in non english OS

by cstar (Initiate)
on Jan 04, 2013 at 07:31 UTC ( [id://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

Replies are listed 'Best First'.
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
Domain Nodelet?
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?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-19 21:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found