def _get_encoding_from_headers(headers):
    # type: (ResponseHeaders) -> Optional[str]
    """Determine if we have any encoding information in our headers.
    """
    if headers and "Content-Type" in headers:
        # Chaquopy: cgi was removed in Python 3.13 - replaced with EmailMessage.
        msg = EmailMessage()
        msg["Content-Type"] = headers["Content-Type"]
        params = msg["Content-Type"].params

        if "charset" in params:
            return params['charset']
    return None
Determine if we have any encoding information in our headers.
    
product/gradle-plugin/src/main/python/pip/_internal/index/collector.py