sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #31966
Re: [Question #265734]: UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 1: ordinal not in range(128)
Question #265734 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/265734
RaiMan posted a new comment:
there is no problem with utf-8 characters when using sikulix.jar to run
a script.
with the latest 1.1.0 running on Java 7+ and using the bundled Jython
2.7, this works:
text = "皇甫春峰"
print "text: ", text
clip = App.getClipboard()
uprint("clip utf-8:", clip) # a Sikulix Jython feature to print strings containing utf-8 characters
print "print normal: ", clip
... before running the script, I take care using ctrl/cmd-c that the 4
chinese characters are on clipboard
this is the output you get:
text: 皇甫春峰
clip utf-8: 皇甫春峰
print normal: [error] script [ Untitled ] stopped with error in line 5
[error] UnicodeEncodeError ( 'ascii' codec can't encode characters in position 0-3: ordinal not in range(128) )
--
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.