I've created a program to print out some html content. My source file is in utf-8, the server's terminal is in utf-8, and I also use:
out = out.encode('utf8') to make sure, the character chain is in utf8. Despite all that, when I use some characters like "ã", "é" in the string out, I get:
UnicodeEncodeError: 'ascii' codec can't encode character '\xe3' in position 84: ordinal not in range(128) It seems to me that the print after:
print("Content-Type: text/html; charset=utf-8 \n\n") It's being forced to use ASCII encoding... But, I just don't know this would be the case.