摘要: 乱码原因: 源码文件的编码格式为utf-8,但是window的本地默认编码是gbk,所以在控制台直接打印utf-8的字符串当然是乱码了!解决方法: 1,print mystr.decode('utf-8').encode('gbk') 2,比较通用的方法:import systype = sys.getfilesystemencoding()print mystr.decode('utf-8').encode(type) 阅读全文
posted @ 2013-10-20 16:10 文豆豆 阅读(11357) 评论(0) 推荐(0) 编辑