Spaces:
Paused
Paused
File size: 631 Bytes
5a81b95 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # sitecustomize.py - Set default encoding to UTF-8 for all Python scripts
# Place this file in Python's site-packages directory to fix Windows emoji issues
import sys
import io
# Force UTF-8 encoding for stdout and stderr
if sys.stdout.encoding != 'utf-8':
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8', errors='replace')
if sys.stderr.encoding != 'utf-8':
sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding='utf-8', errors='replace')
# Set default file encoding to UTF-8
import locale
locale.setlocale(locale.LC_ALL, '')
print("✅ UTF-8 encoding configured automatically", file=sys.stderr)
|