1. 程式人生 > >Python urlencode和urldecode

Python urlencode和urldecode

原文連結:https://blog.csdn.net/qq_39377696/article/details/80454950 

 

在Python3中,將中文進行urlencode編碼使用函式

urllib.parse.quote(string, safe='/', encoding=None, errors=None)

而將編碼後的字串轉為中文,則使用

urllib.parse.unquote(string, encoding='utf-8', errors='replace')