The exception I get is: UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1

From what I read in various forums, the reason could be that my terminal does not support the unicode characters used. However, since I could print the string fine in the first place, this can't be the reason here.

I have a self-contained example showing the problem, and wanted to include it in this post, but if I do this, I always get a SQL error. I guess this is also related to the fact that my code contains unicode characters. Hence, to show the example program, I did two things:

- I uploaded it as attachment, and for the safe side- I also provide a screen shot of the program (just in case the upload also gets messed up). Here it is:

Sorry about the sql errors.The database settings are kinda messed up, so it can't handle some characters correctly.And since it's already filled with weirdly encoded strings, converting to different encoding is non-trivial.I hope to be able to fix it when I'm updating the forum.