void processAttribute(Map.Entry<String, String> attribute) {
        // Ignore duplicate attributes
        if (attributeNames.contains(attribute.getKey())) {
            return;
        }

        attributeNames.add(attribute.getKey());

        // Handle charset-related attributes
        switch (attribute.getKey()) {
            case "http-equiv":
                if (attribute.getValue().equals("content-type")) {
                    gotPragma = true;
                }
                break;
            case "content":
                String charsetName = getEncodingFromMeta(attribute.getValue());
                if (!detectionResult.isFound() && charsetName != null) {
                    detectionResult.find(charsetName);
                    needPragma = true;
                }
                break;
            case "charset":
                detectionResult.find(attribute.getValue());
                needPragma = false;
                break;
            default: // Ignore non-charset related attributes
        }
    }
A class to process the attributes of an HTML meta tag in order to extract a character set.
The user should repeatedly call {@link #processAttribute} on each attributes of the tag,
then update its current detection result with
{@link #updateDetectedCharset(CharsetDetectionResult)}
<p>
The algorithm implemented is meant to match the one described by the W3C here:
https://html.spec.whatwg.org/multipage/parsing.html#prescan-a-byte-stream-to-determine-its-encoding
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-html-module/src/main/java/org/apache/tika/parser/html/charsetdetector/MetaProcessor.java