前言
python3编码和python2有所不同,故此记录.
编码解码
from urllib.parse import quote,unquote
text = "丽江"
print(quote(text,'utf-8'))
str = "%E6%95%B0%E6%8D%AE%E6%8C%96%E6%8E%98"
`print(unquote(str,'utf-8'))
`
python3编码和python2有所不同,故此记录.
from urllib.parse import quote,unquote
text = "丽江"
print(quote(text,'utf-8'))
str = "%E6%95%B0%E6%8D%AE%E6%8C%96%E6%8E%98"
`print(unquote(str,'utf-8'))
`