# -- coding: utf-8 --
import sys
a='大小写'
print(a)
print(sys.stdout.encoding)
print(sys.getdefaultencoding())
print(sys.getfilesystemencoding())
D:\>c:\Python33\python.exe
t.py大小写
cp936
utf-8
mbcs
D:\>chcp
活动代码页: 936
D:\>c:\Python33\python.exe
Python 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 10:55:48) [MSC v.1600 32 bit (In
tel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
我这里没有这个问题啊,奇怪的事情。
还有open这样用应该不会报错了
open(r"d:\111.txt",'w',encoding='utf8')