Skip to content

Commit 19cff44

Browse files
author
Eduardo Rodrigues
committed
fix response with utf8 bom
1 parent 9e27326 commit 19cff44

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

requests/models.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -855,6 +855,9 @@ def text(self):
855855
# Fallback to auto-detected encoding.
856856
if self.encoding is None:
857857
encoding = self.apparent_encoding
858+
# Forcefully remove BOM from UTF-8
859+
elif self.encoding.lower() == 'utf-8':
860+
encoding = 'utf-8-sig'
858861

859862
# Decode unicode from given encoding.
860863
try:

0 commit comments

Comments
 (0)