python中关于字符转换
decode是解码
encode是编码
msg = "我爱你"
print(msg)
print(msg.encode(encoding = "utf-8"))
print(msg.encode(encoding = "utf-8").decode(encoding="utf-8"))
decode是解码
encode是编码
msg = "我爱你"
print(msg)
print(msg.encode(encoding = "utf-8"))
print(msg.encode(encoding = "utf-8").decode(encoding="utf-8"))