mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
fix response with utf8 bom
This commit is contained in:
@@ -855,6 +855,9 @@ class Response(object):
|
||||
# Fallback to auto-detected encoding.
|
||||
if self.encoding is None:
|
||||
encoding = self.apparent_encoding
|
||||
# Forcefully remove BOM from UTF-8
|
||||
elif self.encoding.lower() == 'utf-8':
|
||||
encoding = 'utf-8-sig'
|
||||
|
||||
# Decode unicode from given encoding.
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user