in reply to Re: (Windows) insert text at cursor in non-owned window
in thread (Windows) insert text at cursor in non-owned window

#!perl use utf8; use Win32::GuiTest qw(SendKeys); $Win32::GuiTest::debug = 1;
SendKeys('Hello from another program! ☻ aáàâāăą');

That was easy. But in the foreground application, I get

Hello from another program! aÄÄÄ

What's that now?

Replies are listed 'Best First'.
Welcome to the world of character encodings
by Lu. (Hermit) on Aug 18, 2006 at 13:10 UTC
    That is the symptom of the use of different character encodings.
    I suppose, by the look of it, that you sent a string in Unicode. The receiving application either didn't interpret it as Unicode or is not able to render it on screen.

      I tried it with Xchat, Seamonkey Composer, Opera, DimSum and Unipad. (All written with different toolkits, but Windows application nonetheless.) They exhibit the same symptoms. I'm 100% certain they are unicode capable. I exchange unicode characters freely and without problem among those applications.

      The problem must be with the Perl program.

        Well, then, maybe it comes from Win32::GuiTest, which is not explicitly described as Unicode compliant.
        Since you're using the utf8 module, you can try (untested) :
        SendKeys(utf8::upgrade('$your_string'));
        Hope this works.