1 模块简介 Python 3中最大的变化之一就是删除了Unicode类型.在Python 2中,有str类型和unicode类型,例如, Python 2.7.6 (default, Oct 26 2016, 20:30:19) [GCC 4.8.4] on linux2 Type "help", "copyright", "credits" or "license" for more information. >&g…
实例1: v1=u '好神奇的问题!?' type(v1)->unicode v1.decode("utf-8")# not work,because v1 is unicode already v1.encode("gb2312")#work,convert from unicode into gbk2312 [发现] decode是把指定的对象转化为unicode(unicode包含utf-8,utf-16),并且指明了待转化对象的编码方式. encode…