Jython scripting: unicode strings: paste(utf-8 text) does not work --- workaround
Bug #1370420 reported by
RaiMan
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SikuliX |
Fix Released
|
High
|
RaiMan |
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)
(https:/
did not work for me either...
What else can be done?
Changed in sikuli: | |
status: | New → In Progress |
importance: | Undecided → Medium |
assignee: | nobody → RaiMan (raimund-hocke) |
milestone: | none → 1.2.0 |
Changed in sikuli: | |
status: | In Progress → Fix Released |
summary: |
- [1.1.0] Jython scripting: unicode strings: paste(utf-8 text) does not - work --- workaround + Jython scripting: unicode strings: paste(utf-8 text) does not work --- + workaround |
To post a comment you must log in.
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 otherString, "utf8")
aUnicodeString = unicode(
Some aspects (image filenames in Pattern(...) buttons) must be fixed.