Python and UTF-8 and Windows
Some day, everyone will have their act together when it comes to encoding and decoding of strings that have meaning. Until then, we need hacks.
This is what I do in Python programs that print to the screen. Currently I try to make my Python code work in both Python 2 and Python 3 - I look forward to being able to ditch Python 2, but not yet.
This way, my programs don’t croak when they encounter Unicode codepoints.
This is mostly better in Python 3.5 and up, but still not totally seamless.
Reference
Windows cmd encoding change causes Python crash
Python, Unicode, and the Windows console
Python Helpers for String/Unicode Encoding, Decoding and Printing
Print to the console in Python without UnicodeEncodeErrors - note, this did not work for me in Python 2.7.9
Defining Python Source Code Encodings - I think this is irrelevant now, doesn’t Python assume that your source code is UTF-8?