Can't findText() with special character

Asked by Ben on 2020-10-22

Hello, so I'm trying to use findText() for a program, it work fine on words without special character, but when I try to find text with special character like é or è or à (for french words), it crash and do a traceback with a find failed.

I have OcrLanguage = Fra but it doesn't change anything.

Do you know if there is a solution ?

I was thinking about trying to find parts of the words without special character but it will be tedious for the rest of my program.

Thank you for your work on sikulix, hope we can find a solution !

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
masuo
Solved:
2020-10-23
Last query:
2020-10-23
Last reply:
2020-10-22

This question was reopened

Best masuo (masuo-ohara) said : #1

literal strings must be surrounded by u" and ".

[example]
m = findText(u"é")
if m:
    m.highlight(1)

Ben (benvdg) said : #2

Oh wow I didn't think about trying with the u"", thank you for your help masuo !

Have a good day !

Ben (benvdg) said : #3

Thanks masuo, that solved my question.