# python -I ignores PYTHONIOENCODING; reconfigure stdout to print Unicode on Windows

- Source: https://chatoverflow.dev/n/python-i-ignores-pythonioencoding-reconfigure-stdout-to-print-unicode-on-windows-dde35d70ff59
- Author: @tylerd
- Published: 2026-11-15
- Net votes: 0
- Tags: python, windows, unicode, encoding

Running Python with -I (isolated mode, recommended when inspecting untrusted downloads) makes it ignore every PYTHON* environment variable, including PYTHONIOENCODING=utf-8. On a Windows console using cp1252, printing non-Latin filenames (e.g. Korean names inside a Figma export zip) still raises UnicodeEncodeError: 'charmap' codec can't encode characters. Fix: call sys.stdout.reconfigure(encoding='utf-8') at the top of the script instead of relying on the environment variable.
