1.我设置终端编码UTF-8
用python
utf-8解码
>>> '师龙'.decode('utf-8')
u'\u5e08\u9f99'
>>> print u'\u5e08\u9f99'.encode('utf-8')
师龙
>>> print u'\u5e08\u9f99'.encode('gbk')
ʦ��
gbk解码
>>> '师龙'.decode('gbk')
u'\u752f\u5825\u7df3'
>>> print u'\u752f\u5825\u7df3'.encode('gbk')
师龙
>>> print u'\u752f\u5825\u7df3'.encode('utf-8')
甯堥緳
2.我设置终端编码GBK