【学习记录】Python-Encode&Decode
ASCII全称American Standard Code of Information Interchange
Unicode全称Universal Character Set
GBK缩写来源于“国标扩展”(Guo Biao Kuozhan)
ASCII
print(ord('H'))
:打印字符H的ASCII序数(ordinal:序数的)
Unicode
Python2中,字符串默认以字节未编码的格式保存
x = 'TEST'
type(x)
x = b'TEST'
type(x)
返回值均为<type 'string'>
Python3中,字符串默认以Unicode编码的格式保存
x = 'TEST'
type(x)
x = u'TEST'
type(x)
返回值均为<class 'string'>
GBK
GBK全称汉字内码扩展规范