标签:name nbsp code unicode pre col 二进制 utf-8 byte
name = "张全蛋" print(name.encode("utf-8")) print(type(name.encode("utf-8"))) byte = name.encode("utf-8") print(byte.decode("utf-8")) # encode unicode - > utf-8 将unicode的字符 转为制定的二进制 # decode utf-8 - > unicode 将二进制转为unicode
标签:name nbsp code unicode pre col 二进制 utf-8 byte
原文地址:https://www.cnblogs.com/Hale-wang/p/10354248.html