sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #28347
[Bug 1370420] Re: [1.1.0] Jython scripting: paste(utf-8 text) does not work --- workaround
I will write a HowTo into the docs about unicode handling in Sikuli
scripts using Python language.
A general rule for version 1.1.0+:
Despite the fact, that strings containing unicode characters are shown correctly in the IDE, the usage at runtime (string functions, image filenames, Sikuli features accepting strings as parameters (e.g. paste()), ...) might make problems.
To avoid these possible problems, one should always use this notation for strings containing unicode characters:
aUnicodeString = u"cyrillic: тест"
now this string will be handled correctly at runtime all over the place.
any string (e.g. text loaded from a file) can be marked as being a unicode string by using:
aUnicodeString = ucode(otherString)
which is a convenience shortcut for
aUnicodeString = unicode(otherString, "utf8")
Some aspects (image filenames in Pattern(...) buttons) must be fixed.
** Description changed:
***** workaround
use instead until fixed:
- paste(unicode("тест", "utf8"))
+ paste(ucode("тест"))
+
+ which is convenience shortcut for
+ paste(ucode("тест", "utf8"))
--------------------------------------------------------
Trying to paste any cyrillic string in LinuxMint 17 XFCE inside Firefox results in something like that:
paste('тест') => тест
Tried regional settings RU/ENG, Firefox RU/ENG. Tried solution from here:
t='somestring'
paste(t).encode("UTF-8")) # hand it over with utf-8 encoding
(https://answers.launchpad.net/sikuli/+question/169226)
did not work for me either...
What else can be done?
** Summary changed:
- [1.1.0] Jython scripting: paste(utf-8 text) does not work --- workaround
+ [1.1.0] Jython scripting: unicode strings: paste(utf-8 text) does not work --- workaround
** Description changed:
***** workaround
+ general aspects: see comment #1
+
use instead until fixed:
paste(ucode("тест"))
which is convenience shortcut for
paste(ucode("тест", "utf8"))
--------------------------------------------------------
Trying to paste any cyrillic string in LinuxMint 17 XFCE inside Firefox results in something like that:
paste('тест') => тест
Tried regional settings RU/ENG, Firefox RU/ENG. Tried solution from here:
t='somestring'
paste(t).encode("UTF-8")) # hand it over with utf-8 encoding
(https://answers.launchpad.net/sikuli/+question/169226)
did not work for me either...
What else can be done?
** Changed in: sikuli
Importance: Medium => High
--
You received this bug notification because you are a member of Sikuli
Drivers, which is subscribed to Sikuli.
https://bugs.launchpad.net/bugs/1370420
Title:
[1.1.0] Jython scripting: unicode strings: paste(utf-8 text) does not
work --- workaround
Status in Sikuli:
In Progress
Bug description:
***** workaround
general aspects: see comment #1
use instead until fixed:
paste(ucode("тест"))
which is convenience shortcut for
paste(ucode("тест", "utf8"))
--------------------------------------------------------
Trying to paste any cyrillic string in LinuxMint 17 XFCE inside Firefox results in something like that:
paste('тест') => тест
Tried regional settings RU/ENG, Firefox RU/ENG. Tried solution from here:
t='somestring'
paste(t).encode("UTF-8")) # hand it over with utf-8 encoding
(https://answers.launchpad.net/sikuli/+question/169226)
did not work for me either...
What else can be done?
To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/1370420/+subscriptions
References