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

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
Node Status?
node history
Node Type: perlquestion [id://1011573]
Approved by Corion
help
Chatterbox?
SuicideJunkie replaces stale cookies with fresh on the platter on the sideboard.
[SuicideJunkie]: So, possibly interesting thing; I had that script which was using more than all the ram to open an absurdly large spreadsheet. I set it up to spin overnight nightly, so it stopped releasing memory since it was never fully exited.
[SuicideJunkie]: Didn't expect that to be a problem. There's plenty of disk space for swap, and the memory space would be reused the next day. But apparently virtualbox dies with a guru meditation when there's no physical memory unused on start.

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (4)
As of 2017-04-26 22:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (491 votes). Check out past polls.