Search code examples
pythonsikuli

How to convert a script to UTF-8


I have a Sikuli/Python Script that works very good.
Since I am Dutch we have the same letters in our alphabet as the English alphabet.

Now there is however one letter that we have that does not occur in the alphabet, but that is used in Dutch grammar.
The ë.
Now Sikuli falls over it becuase it doesn't belong in the English alphabet.
We also have Belgium custumers that might use French on it in the future.

How can I make that all my Scripts look at UTF-8, and not at ASCII (what seems to be the default)?


Solution

  • In order to specify that your module shall include utf-8 encoding, use this encoding declaration in the header or footer of your file, as per PEP 0263:

    # -*- coding: utf-8 -*-