Skip to content
Myr

Default the encoding of "text" media subtypes to "ISO-8859-1"

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Ref. RFC2616 (HyperText Transfer Protocol), section 3.7.1 (Canonicalization and Text Defaults).

authored by Johannes Gorset · committed by Johannes Gorset · parent 5bff8e3 · Browse files · 1 file+3 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+3 added−0 removed

  • other:+3 added−0 removed

1 file+3 added−0 removed

modified:requests/utils.py+3 added
274 unmodified lines
275276 if 'charset' in params:277 return params['charset'].strip("'\"")278279 if 'text' in content_type:280 return 'ISO-8859-1'281282283def unicode_from_html(content):284 """Attempts to decode an HTML string into unicode.285 If unsuccessful, the original content is returned.286 """
115 unmodified lines