fix response with utf8 bom

This commit is contained in:
Eduardo Rodrigues
2019-02-09 22:14:22 +01:00
parent 9e27326d68
commit 19cff44ec1
+3
View File
@@ -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: