python2.7解决输出中文乱码问题
时间:2016-11-08 13:45:05
收藏:0
阅读:423
#!/usr/bin/env python
#coding=utf-8
s="中文"
if isinstance(s, unicode):
#s=u"中文"
print s.encode(‘gb2312‘)
else:
#s="中文"
print s.decode(‘utf-8‘).encode(‘gb2312‘)
原文:http://www.cnblogs.com/jinjidedale/p/6042449.html
评论(0)