浅析Python的codecs模块 编码转化 codecs.open() 总结 Reference 编码转化 codecs专门用作编码转换。 # -*- encoding: gb2312 -*- import codecs, sys print ' - ' * 60 # 创建gb2312编码器 look = codecs.lookup( " gb2312 " ) # 创建utf-8编码器 look2