pasting the Chinese characters in textbox of some application will appear garbled

Asked by can

Since using the windows encoded by gbk, when pasting the Chinese characters in textbox of some application will appear garbled.

#my code
outtext = "中文输出"
paste(unicode(outtext,"utf8"))

or

outtext = u"中文输出"
paste(outtext)

Is there any way to solve this problem?

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
can
Solved:
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

Just tested with a Win7-64 and Java7 with latest version 1.1.0:

this worked:
outtext = "中文输出“
paste(unicd(outtext))

unicd() or ucode() is a function that comes with SikuliX in the Python layer and is a shortcut for unicode(text, "utf8“) (which worked also).

Revision history for this message
can (ting) said :
#2

I tried this method, but the effect is not very good.

The result in the input box is "涓枃杈撳嚭", which is not what I want.

My APP is programmed with MFC.This will have an impact on the results.

Revision history for this message
RaiMan (raimund-hocke) said :
#3

To make my test, I just used a normal editor window, to paste outtext.
The window then contains exactly the given text.

S o you should make such a test on your system, to prove, that SikuliX works as it should.

If it works, I have no idea, what your problem is or what you can do.

Revision history for this message
can (ting) said :
#4

i got it