import urllib,requests a = "height%22%3A40%2C%22urldecode转中文" b = urllib.parse.unquote(a) print(b) c = "中文转urlencode" d = urllib.parse.quote(c) print(d)