msg
="我爱北京天安门"
print(msg
)
输出:我爱北京天安门
print(msg
.encode
(encoding
="utf-8"))
output: b’\xe6\x88\x91\xe7\x88\xb1\xe5\x8c\x97\xe4\xba\xac\xe5\xa4\xa9\xe5\xae\x89\xe9\x97\xa8’
print(msg
.encode
(encoding
="utf-8").decode
(encoding
="utf-8"))
output: 我爱北京天安门
转载请注明原文地址: https://lol.8miu.com/read-19063.html