Skip to content

Instantly share code, notes, and snippets.

@logicjwell
Created May 6, 2019 12:26
Show Gist options
  • Save logicjwell/5712ecafaa40f8d3d2697cd387cc000f to your computer and use it in GitHub Desktop.
Save logicjwell/5712ecafaa40f8d3d2697cd387cc000f to your computer and use it in GitHub Desktop.
[python3中urlencode和urldecode] #python3 #url #urlencode #urldecode
在Python3中,将中文进行urlencode编码使用函数
urllib.parse.quote(string, safe='/', encoding=None, errors=None)
而将编码后的字符串urldecode转为中文,则使用
urllib.parse.unquote(string, encoding='utf-8', errors='replace')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment