patrys / httmock

A mocking library for requests
Other
468 stars 57 forks source link

Set response.encoding to the charset from the Content-Type header. #50

Closed wieslander closed 7 years ago

wieslander commented 7 years ago

Emulate the behaviour of the unmocked Requests library, where the 'encoding' attribute of Response objects is set to the charset specified in the Content-Type header. Without this, response.text may in certain situations get decoded to Unicode using the wrong encoding.