← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #201882]: Replace chars in a var

 

Question #201882 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/201882

    Status: Open => Answered

RaiMan proposed the following answer:
If you work in Sikuli IDE, strings are interpreted as UTF-8 encoded.

The following works in the IDE as expected:

x = "Jørgen Ålesen"
y = "Jørgen Ålesen"
print "x:", x
print "y:", y
if x == y: print "are equal" 
else: print "are not equal"

and prints in the message area:

x: Jørgen Ålesen
y: Jørgen Ålesen
are equal

So if you read the names from a file, you have to make sure, that the lines read are UTF-8 encoded (by file encoding) and/or you have to convert the strings afterwards.
Specifics you can find in the Python docs in the file and the encoding section.

see: https://answers.launchpad.net/sikuli/+question/181657

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.