gb2312编码转换

>>> a = u"中文"
>>> print(a)
中文
>>> a_utf_8 = a.encode("utf-8")
>>> print(a_utf_8.decode("utf-8"))
中文
>>> a_gb2312 = a.encode('gb2312')
>>> print(a_gb2312.decode("gb2312"))
中文
>>> 
原文地址:https://www.cnblogs.com/ylsd80/p/7444687.html