摘要:
字符串编码常用类型:utf-8,gb2312,cp936,gbk等。python中,我们使用decode()和encode()来进行解码和编码在python中,使用unicode类型作为编码的基础类型。即 decode encodestr ---------> unicode --------->stru = u'中文' #显示指定unicode类型对象ustr = u.encode('gb2312') #以gb2312编码对unicode对像进行编码str1 = u.encode('gbk') #以gbk编码对unicode对像进行 阅读全文