mirror of
https://gitee.com/g1879/DrissionPage.git
synced 2024-12-10 04:00:23 +08:00
若从headers和meta获取不到编码,用r.apparent_encoding获取
This commit is contained in:
parent
da079ce7b7
commit
adeba1fec6
@ -364,7 +364,7 @@ class SessionPage(object):
|
|||||||
try:
|
try:
|
||||||
charset = re_result.group(1)
|
charset = re_result.group(1)
|
||||||
except:
|
except:
|
||||||
charset = 'utf-8'
|
charset = r.apparent_encoding
|
||||||
else:
|
else:
|
||||||
charset = headers['Content-Type'].split('=')[1]
|
charset = headers['Content-Type'].split('=')[1]
|
||||||
# 避免存在退格符导致乱码或解析出错
|
# 避免存在退格符导致乱码或解析出错
|
||||||
|
Loading…
x
Reference in New Issue
Block a user