from urllib.parse import quote,unquote d = {‘lang‘:‘python‘,‘type‘:‘testing‘,‘ccountry‘:quote(‘中国‘)} print(d) #执行结果:{‘lang‘: ‘python‘, ‘type‘: ‘testing‘, ‘ccountry‘: ‘%E4%B8%AD%E5%9B%BD‘} print(unquote(‘%E4%B8%AD%E5%9B%BD‘)) #执行结果:中国
原文地址:https://www.cnblogs.com/xiaobaibailongma/p/12353301.html
时间: 2024-09-30 21:00:44