Problem with swedish characters

Asked by DH on 2020-11-05

Hi, I've a problem with printing swedish characters on my Windows 10 client.
This is my use case:

On top of Sikuli-script:

#! /usr/bin/env python
# -*- coding: utf-8 -*-
# -*- coding: ISO-8859-1 -*-
import re
import sys
import codecs

testHeader = find(My_image_with_swedish_charchters_åäö_ÅÄÖ).text()

When I print testHeader, the text from the image is not formated ok.
It's supposed to be : ÄlvdalenHejHå

But gives: AlvdalenHejHa

Tried with print (testHeader .encode("utf-8"))

When I try without found(image) It works just fine.

Example here:

#! /usr/bin/env python
# -*- coding: utf-8 -*-
# -*- coding: ISO-8859-1 -*-
import codecs

print ("Bevara kÄllkåden föÖr framtiden!") gives: Bevara kÄllkåden föÖr framtiden!

Any ideas?

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
2020-11-06
Last query:
2020-11-06
Last reply:
2020-11-05

This question was reopened

DH (dh72) said : #2

Thanks RaiMan, that solved my question.