python3 -X utf8 script.py

Category: Python & pip

python3 -X utf8 script.py

Force UTF-8 mode for stdio and file I/O regardless of locale

Forces UTF-8 encoding for stdin, stdout, and file I/O, regardless of the system locale setting.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.