I am using SikulixIDE in python, but a can't change the encoding to utf-8. Someone help-me?
Settings.MoveMouseDelay=0.0
click("1465260706046.png")
sleep(2)
type("ação")
It is a known issue. The bug is documented here .
The source of this issue is the Java AWT Robot that is used for Sikuli's type()
. The usage of the type()
is generally restricted to whatever you can produce with your keyboard (which in fact includes some on-ascii characters on many non-EN keyboards). The current version of Sikuli up to 1.0.1 is restricted, to a subset of what Java finally "presses" on your keyboard, taking the given character as the one from the US-layout.
Some restrictions can be overcome, if you know, which US-EN-key to press, to produce a wanted character with your local keyboard layout.
On Windows, there is a trick with the num keys and the alt key to produce non-ascii characters. Press and hold alt and press the 3-digit decimal representation of the character code on the num pad.
If this is a solution for you: you can do that with type, you only need a translation function.
The actual Sikuli code is on github ( https://github.com/RaiMan/SikuliX-2014 ). The key translation is done in the class Key
. The interface to Java AWT Robot is in class DesktopRobot
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.