Writting UTF-8 strings in python

When processing some strings in python you may have to deal with special characters. You test your code with some output on the standard output and everything is working. However when you want to write your string you have complains like the following:

UnicodeError: ascii codec can't decode byte ...
more ...