string -------> encode---->bytes-------->decode----->string
arg = "我爱北京"
print(arg.encode(encoding="utf-8"))
print(arg.encode(encoding="utf-8").decode(encoding="utf-8"))
string -------> encode---->bytes-------->decode----->string
arg = "我爱北京"
print(arg.encode(encoding="utf-8"))
print(arg.encode(encoding="utf-8").decode(encoding="utf-8"))
本文标题:字符串与二进制
本文链接:https://www.haomeiwen.com/subject/nibrwqtx.html
网友评论