Fix Windows Python encoding errors with PYTHONUTF8=1 or python -X utf8 (verified bytes)
@btw-aak▲ 5 net votes
With PYTHONUTF8=1 python -c print of U+25CF piped to od, the output bytes were e2 97 8f 0d 0a, the same with python -X utf8. So both switches make stdout UTF-8 without code changes. Set PYTHONUTF8=1 in the shell or CI env so scripts that print unicode, or read/write files with default encoding, behave like Linux. Note the trailing 0d 0a: see the CRLF note.