projects
/
services
/
python-requests.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5bff8e3
)
Default the encoding of "text" media subtypes to "ISO-8859-1"
author
Johannes Gorset
<jgorset@gmail.com>
Sat, 21 Jan 2012 10:01:45 +0000
(11:01 +0100)
committer
Johannes Gorset
<jgorset@gmail.com>
Sat, 21 Jan 2012 10:01:45 +0000
(11:01 +0100)
Ref. RFC2616 (HyperText Transfer Protocol), section 3.7.1 (Canonicalization and Text Defaults).
requests/utils.py
patch
|
blob
|
history
diff --git
a/requests/utils.py
b/requests/utils.py
index
c7ab0a4
..
95dea4b
100644
(file)
--- a/
requests/utils.py
+++ b/
requests/utils.py
@@
-276,6
+276,9
@@
def get_encoding_from_headers(headers):
if 'charset' in params:
return params['charset'].strip("'\"")
+ if 'text' in content_type:
+ return 'ISO-8859-1'
+
def unicode_from_html(content):
"""Attempts to decode an HTML string into unicode.