decode:把一种编码转换成 unicode ---> 解码
# byte -> str
>>> a =b'hello'
>>> a
b'hello'
>>> a.decode('utf-8')
'hello'
>>>
encode:把unicode转换成另一种编码 ---> 编码
# str -> byte
>>> a = 'hello'
>>> a
'hello'
>>> a.encode('utf-8')
b'hello'
decode:把一种编码转换成 unicode ---> 解码
# byte -> str
>>> a =b'hello'
>>> a
b'hello'
>>> a.decode('utf-8')
'hello'
>>>
encode:把unicode转换成另一种编码 ---> 编码
# str -> byte
>>> a = 'hello'
>>> a
'hello'
>>> a.encode('utf-8')
b'hello'