'Returns info extracted from an HTML content-type meta tag if any.
Returns (<has-http-content-type-info>, <content-type>, <charset>).
For example:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
yields:
(True, "text/html", "utf-8")'

def _get_http_content_type_info(self, head_bytes):

    for meta_tag in self._html_meta_tag_pat.findall(head_bytes):
        meta = dict(((k.lower(), v[1:(-1)]) for (k, v) in self._html_attr_pat.findall(meta_tag)))
        if (('http-equiv' in meta) and (meta['http-equiv'].lower() == 'content-type')):
            content = meta.get('content', '')
            break
    else:
        return (False, None, None)
    parts = [p.strip() for p in self._http_content_type_splitter.split(content)]
    if (not parts):
        return (False, None, None)
    content_type = (parts[0] or None)
    for p in parts[1:]:
        if p.lower().startswith('charset='):
            charset = p[len('charset='):]
            if (charset and (charset[0] in ('"', "'"))):
                charset = charset[1:]
            if (charset and (charset[(-1)] in ('"', "'"))):
                charset = charset[:(-1)]
            break
    else:
        charset = None
    return (True, content_type, charset)
