标签: python encoding utf-8 ascii
我正在使用Python 3.4,我需要更改默认编码,但我不知道如何操作。在Python 2.x上,可以使用以下技巧:
import sys reload(sys) # Reload does the trick! sys.setdefaultencoding('UTF8')
但它不再适用于Python 3.x.我的默认编码是US-ASCII,但我需要使用UTF-8来导出带重音的字典。
US-ASCII
UTF-8