def _get_charset(headers):
    """Gets response charset.

    Args:
        headers: The HTTP response headers as dict.

    Returns:
        A response charset or None.
    """
    content_type = headers.get('content-type')
    charset = None

    if content_type is not None:
        parts = content_type.split('charset=')
        if len(parts) == 2:
            charset = parts[-1]

    return charset