python中對URL編碼
urllib包中parse子產品的quote和unquote
from urllib import parse
#這個是js的結果
# encodeURIComponent('中國')
# "%E4%B8%AD%E5%9B%BD"
jsRet='%E4%B8%AD%E5%9B%BD'
print(parse.unquote(jsRet)) #輸出:中國
print(jsRet==parse.quote('中國')) #輸出:True
複制