kennethreitz/requests — pull request #2161 by likexian (2014-08-07 03:32:45+00:00)
Title: add auto detect charset from http body content when http headers not seted

requests detect page charset from response http headers, but with many servers it won't return the charset.
In this case, requests will set the charset to default 'ISO-8859-1', and then result in decoded error, many Chinses developer as me got lose and don't know how to resolve it.
For example:
print requests.get('http://www.126.com/').text

This commit will detect charset from http header, if not seted, detect from http body, for most page, everything goes well now.