From: Kenneth Reitz Date: Wed, 15 Feb 2012 08:09:40 +0000 (-0500) Subject: remove bunk utils for decoding X-Git-Tag: v0.10.2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b5212ddc3dcde30e3d0e3daefcc49e2dd76049ff;p=services%2Fpython-requests.git remove bunk utils for decoding --- diff --git a/requests/utils.py b/requests/utils.py index 3f8b9fc..d35b332 100644 --- a/requests/utils.py +++ b/requests/utils.py @@ -291,23 +291,6 @@ def get_encoding_from_headers(headers): return 'ISO-8859-1' -def unicode_from_html(content): - """Attempts to decode an HTML string into unicode. - If unsuccessful, the original content is returned. - """ - - encodings = get_encodings_from_content(content) - - for encoding in encodings: - - try: - return str(content, encoding) - except (UnicodeError, TypeError): - pass - - return content - - def stream_decode_response_unicode(iterator, r): """Stream decodes a iterator.""" @@ -358,16 +341,6 @@ def get_unicode_from_response(r): except TypeError: return r.content - -def decode_gzip(content): - """Return gzip-decoded string. - - :param content: bytestring to gzip-decode. - """ - - return zlib.decompress(content, 16 + zlib.MAX_WBITS) - - def stream_decompress(iterator, mode='gzip'): """ Stream decodes an iterator over compressed data