仅仅是urllib2.unquote_plus解码是不够的,需要将特殊字符去掉

ILLEGAL_CHARACTERS_RE = re.compile(r'[\000-\010]|[\013-\014]|[\016-\037]|\xef|\xbf')
value = ILLEGAL_CHARACTERS_RE.sub('', origin_value)
由于\xef|\xbf的存在,导致字符串乱码,查了一下这是作为utf-8 BOM的存在,需要过滤掉。

BOM: https://en.wikipedia.org/wiki/Byte_order_mark#UTF-8

ASCII Characters: http://donsnotes.com/tech/charsets/ascii.html

 

Then, it worked for me.

相关文章:

  • 2022-01-25
  • 2021-07-23
  • 2022-03-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-19
  • 2022-12-23
  • 2022-12-23
  • 2022-01-20
  • 2021-12-17
  • 2022-12-23
  • 2021-07-22
相关资源
相似解决方案