Trying to type non-ascii characters with "paste(ucode(text))" is raising the UnicodeEncodeError Exception

Asked by edlothiad

I'm trying to type the following line:

type("§§§" + Key.ENTER)

After searching on here I found out about the "paste(ucode(text))", however after trying that I got stuck with the same error, notably:

IDE: (org.sikuli.scriptrunner.JythonScriptRunner@259dd9ac).runScript: Exception: UnicodeEncodeError: 'ascii' codec can't encode characters in position 152-157: ordinal not in range(128)

I've looked around on the internet but to no avail.

Help would be appreciated.

Question information

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

just use

paste("§§§")
type(Key.ENTER)

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

Sorry, 2fast4me ;-)

paste(ucode("§§§"))

is the correct use.
Make sure, you are running at least version 1.1.1

Revision history for this message
edlothiad (edlothiad) said :
#3

Thanks RaiMan, that solved my question.