We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
get_encoding_from_headers
1 parent d0359c9 commit 5855dd7Copy full SHA for 5855dd7
requests/utils.py
@@ -503,6 +503,10 @@ def get_encoding_from_headers(headers):
503
if 'text' in content_type:
504
return 'ISO-8859-1'
505
506
+ if 'application/json' in content_type:
507
+ # Assume UTF-8 based on RFC 4627: https://www.ietf.org/rfc/rfc4627.txt since the charset was unset
508
+ return 'utf-8'
509
+
510
511
def stream_decode_response_unicode(iterator, r):
512
"""Stream decodes a iterator."""
0 commit comments