I have Python 2.7.1 on a Simplified-Chinese version of Windows XP, and I have a program like this(windows_prn_utf8.py):
#!/usr/bin/env python # -*- coding: u
Set PYTHONIOENCODING environmental variable.
PYTHONIOENCODING
SET PYTHONIOENCODING=cp936 windows_prn_utf8.py > 1.txt