(headers)
Returns encodings from given HTTP Header Dict.

    :param headers: dictionary to extract encoding from.
Returns encodings from given HTTP Header Dict.
Returns encodings from given HTTP Header Dict .
def get_encoding_from_headers(headers):
    """Returns encodings from given HTTP Header Dict.

    :param headers: dictionary to extract encoding from.
    """

    content_type = headers.get('content-type')

    if not content_type:
        return None

    content_type, params = cgi.parse_header(content_type)

    if 'charset' in params:
        return params['charset'].strip("'\"")

    if 'text' in content_type:
        return 'ISO-8859-1'
def get_encoding_from_headers ( headers ) : content_type = headers . get ( 'content-type' ) if not content_type : return None content_type , params = cgi . parse_header ( content_type ) if 'charset' in params : return params [ 'charset' ] . strip ( "'\"" ) if 'text' in content_type : return 'ISO-8859-1'