>>> from urllib.parse import quote >>> quote('汉字') '%E6%B1%89%E5%AD%97' >>> import urllib >>> urllib.parse.unquote('%E6%B1%89%E5%AD%97') '汉字' >>>
>>> url = 'http://localhost:8000/odooallpro/%E7%9B%B8%E5%86%8C/' >>> urllib.parse.unquote(url) 'http://localhost:8000/odooallpro/相册/' >>>
转载于:https://www.cnblogs.com/helloxiaoyu/p/8779700.html