kennethreitz/requests — pull request #2208 by mlissner (2014-09-06 23:12:58+00:00)
Title: Changes the fallback text encoding to cp1252

In my use of Requests, [I noticed at some point][1] that text that was encoded as cp1252 was coming back as ISO-8859-1. While in many cases, that's a fine fallback encoding, cp1252 is a superset of ISO-8859-1, making it right even more often.

Walking through the scenarios, just to make sure I'm not missing something:

1. Text is encoded as cp1252, but is misidentified as ISO-8859-1. Result: Characters from the cp1252 superset will be mojibake.
2. Text is encoded as cp1252 and is identified as cp1252. Result: All good.
3. Text is encoded as ISO-8859-1, but is misidentified as cp1252. Result: All good. Superset in cp1252 encoding won't cause a problem.
4. Text is encoded as ISO-8859-1 and is identified as ISO-8859-1. Result: All good.

So, I think this can only do good, but encodings have never been my friend, and I'd be only slightly surprised if I missed something.

[1]: https://stackoverflow.com/questions/11588458/how-to-handle-encodings-using-python-requests-library