python3 编码问题
出现%u问题
s = "%u0035%u0034%u0031%u0039%u0038%u0039%u0039%u0038"
r = s.replace("%", "\\").encode('utf-8').decode('unicode_escape')
html编码解码
from html import unescape
r = unescape(s)
json数据的键是变量的时候
import demjson
demjson.decode(item)
URL编码
import urllib.parse
# 解码
s = urllib.parse.unquote(link)
# 编码
link = urllib.parse.quote(url)
html转义
如: '; &; <; >; "; ';等
import html
转义
str_huml = html.escape(str_org)
还原
str_org = html.unescape(str_huml )