菜鸟IT的博客 >> Python
URL转码解码 | quote | unquote | 16进制码和百分号加起来点符号是什么东西 | UrlEncode编码 | UrlDecode解码
from urllib.request import quote,unquote
cEmsKind_ZhuiZong="中邮给据邮件"
ZhuanMa1=quote(cEmsKind_ZhuiZong,encoding="gb2312")
ZhuanMa2=quote(cEmsKind_ZhuiZong,encoding="utf-8")
print(ZhuanMa1)
print(ZhuanMa2)
# 开始解码↓
JieMa1=unquote(ZhuanMa1,encoding="gb2312")
print(JieMa1)
JieMa2=unquote(ZhuanMa2,encoding="utf-8")
print(JieMa2)
菜鸟IT博客[2022.02.01-12:42] 访问:280