UTF-8 = unicode的扩展集,可变长的字符编码集
ascii --> gb2312 --> gbk1.0 -->gb18030
ascii --> unicode --> utf-8
Python2.x == ascii是其默认编码
如果在2.x中需要使用utf-8,需要以下声明:
#!-*- coding:utf-8 -*-
#coding:utf-8
Python3.x == unicode是其默认编码
unicode是向下兼容gb2312和gbk
UTF-8 = unicode的扩展集,可变长的字符编码集
ascii --> gb2312 --> gbk1.0 -->gb18030
ascii --> unicode --> utf-8
Python2.x == ascii是其默认编码
如果在2.x中需要使用utf-8,需要以下声明:
#!-*- coding:utf-8 -*-
#coding:utf-8
Python3.x == unicode是其默认编码
unicode是向下兼容gb2312和gbk