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的编码解码知识:

待更新

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-07-11
  • 2022-12-23
  • 2021-05-25
  • 2021-04-27
  • 2022-01-14
猜你喜欢
  • 2021-07-14
  • 2021-11-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案