mirror of
https://gitee.com/g1879/DrissionPage.git
synced 2024-12-10 04:00:23 +08:00
修复response的headers中无charset导致乱码的问题
This commit is contained in:
parent
6d799fd807
commit
058715be70
@ -203,6 +203,14 @@ class SessionPage(object):
|
|||||||
except:
|
except:
|
||||||
return_value = False
|
return_value = False
|
||||||
else:
|
else:
|
||||||
# r.encoding = 'utf-8'
|
headers = dict(r.headers)
|
||||||
|
if 'Content-Type' not in headers:
|
||||||
|
charset = 'utf-8'
|
||||||
|
else:
|
||||||
|
if 'charset' not in headers['Content-Type']:
|
||||||
|
charset = 'utf-8'
|
||||||
|
else:
|
||||||
|
charset = headers['Content-Type'].split('=')[1]
|
||||||
|
r.encoding = charset
|
||||||
return_value = r
|
return_value = r
|
||||||
return return_value
|
return return_value
|
||||||
|
Loading…
x
Reference in New Issue
Block a user