← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #156443]: how to use the paste function to input chinese

 

Question #156443 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/156443

    Status: Answered => Open

coldtest is still having a problem:
 Thanks you soooooo much ,RaiMan  , I resoved the problem as your suggestion
,  at first ,I modify the jython.bat as :

set _FULL_CMD=%_JAVA_CMD%  -Dfile.encoding=utf-8 %_JAVA_OPTS% %_JAVA_MEM%
%_JAVA_STACK% -Dpython.home=%_JYTHON_HOME% -Dpython.executable="%~f0"
%_BOOT_CP% -classpath "%CLASSPATH%" org.python.util.jython %_JYTHON_OPTS%
%_JYTHON_ARGS% %_ARGS%
echo %_FULL_CMD%

I add the paramter "-Dfile.encoding=utf-8 "  in  jython.bat

at second ,  I modify the test.py :
chage "seach_key = u'梅西' " to seach_key = '梅西'

when I run the test.rb, yes , It's successly to search what I want .

D:\script\jy>jython test.py
"C:\Program Files\Java\jre6\bin\java"  -Dfile.encoding=utf-8  -Xmx512m
-Xss1152k
 -Dpython.home="D:\jython2.5.2"
-Dpython.executable="D:\jython2.5.2\jython.bat"
 -classpath
"D:\jython2.5.2\jython.jar;.;D:\jython2.5.2\sikuli-script.jar;D:\Pro
gram Files\Sikuli\sikuli-script.jar" org.python.util.jython   test.py
[info] Sikuli vision engine loaded.
[info] Windows utilities loaded.
[info] VDictProxy loaded.
[log] App.focus C:\Program Files\Internet Explorer\IEXPLORE.EXE(0) #0
[log] CLICK on (509,126)
[log] TYPE "
"
[log] CLICK on (668,389)
[log] CLICK on (829,428)


thanks you again . you  are so kind , sikuli is so good and I love it very
much .


2011/5/8 RaiMan <question156443@xxxxxxxxxxxxxxxxxxxxx>

> Your question #156443 on Sikuli changed:
> https://answers.launchpad.net/sikuli/+question/156443
>
>    Status: Open => Answered
>
> RaiMan proposed the following answer:
> I confirm, that your approach does not solve the problem.
>
> But since I know, that it works in the Sikuli IDE, I had a look at the
> sources to find out, how they manage it.
>
> You need 2 things:
>
> --1. Python encoding directive (you did it already)
> in the first or second line os your script you need a magic comment that
> defines the encoding used for the script:
> # coding=utf-8
>
> there are some other options, but for a Jython script this works.
>
> --2. you have to tell the JVM, the same thing by giving this as a parameter
> when calling the JVM:
> -Dfile.encoding=utf-8
>
> When I did this with the Sikuli contained Jython 2.5.1 it worked, the
> same way as it does in the Sikuli-IDE:
>
> java -Dfile.encoding=utf-8 -cp absolute-path-to\sikuli-script.jar
> org.python.util.jython utftest.py
>
> The script successfully pastes a unicode character into a unicode aware
> inputfield, e.g.
> paste("<é>")
>
> So you have to find out, how to add this parameter to the Java/Jython
> environment of Jython2.5.2 (I remember, that the comments in the
> jython.bat give some hints about the recognized environment variables).
>
> hope it helps.
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
> https://answers.launchpad.net/sikuli/+question/156443/+confirm?answer_id=2
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/sikuli/+question/156443
>
>  You received this question notification because you asked the question.
>

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.