#-*-coding:utf-8-*-
#__author:martin
#date:2017/10/21
s = 'hello可乐'
#编码 str类型 ---> 16进制bytes类型
b = s.encode('utf8')
print(type(b))
print(b)#b'hello\xe8\x99\x8e'
#解码 16进制bytes类型--->str类型
s_n = str(b,'utf8')
print(s_n)
#-*-coding:utf-8-*-
#__author:martin
#date:2017/10/21
s = 'hello可乐'
#编码 str类型 ---> 16进制bytes类型
b = s.encode('utf8')
print(type(b))
print(b)#b'hello\xe8\x99\x8e'
#解码 16进制bytes类型--->str类型
s_n = str(b,'utf8')
print(s_n)