Fix the stdout stream, which needs to be wrapped in a stream writer
codec, to ensure UTF-8 characters are not encoded in ascii; which causes
UnicodeDecodeError exceptions.