from urllib.parse import quote,unquote
# 编码
c = '张飒'
print(quote(c,'utf-8'))
# 解码
str = "%E5%BC%A0%E9%A3%92"
print(unquote(str,'utf-8'))
python3 编码&解码
最新推荐文章于 2024-07-27 12:20:46 发布
from urllib.parse import quote,unquote
# 编码
c = '张飒'
print(quote(c,'utf-8'))
# 解码
str = "%E5%BC%A0%E9%A3%92"
print(unquote(str,'utf-8'))