标签:
python3
>>> u‘中国‘.encode(‘utf-8‘) #unicode 转化成utf-8 b‘\xe4\xb8\xad\xe5\x9b\xbd‘ >>> b‘\xe4\xb8\xad\xe5\x9b\xbd‘.decode(‘utf-8‘) #utf-8 转化成unicode ‘中国‘
utf-8 1-6个字节
decode,encode
原文地址:http://www.cnblogs.com/Citizen/p/4610309.html