1、网址链接中的中文编码
- 中文的gbk(GB2312)编码: 一个汉字对应两组%xx,即%xx%xx
- 中文的UTF-8编码: 一个汉字对应三组%xx,即%xx%xx%xx
2、编码:
1 from urllib.parse import quote 2 text = quote(text, 'utf-8')
3、解码:
1 from urllib.parse import unquote 2 text = unquote(text, 'utf-8')
4、python的编码解码知识:
待更新
1 from urllib.parse import quote 2 text = quote(text, 'utf-8')
1 from urllib.parse import unquote 2 text = unquote(text, 'utf-8')
待更新
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。