public void find(String charsetName) {
        this.found = true;
        charsetName = charsetName.trim();
        if ("x-user-defined".equals(charsetName)) {
            charsetName = "windows-1252";
        }
        this.charset = CharsetAliases.getCharsetByLabel(charsetName);
        // The specification states: If charset is a UTF-16 encoding, then set charset to UTF-8.
        if (UTF_16LE.equals(charset) || UTF_16BE.equals(charset)) {
            charset = UTF_8;
        }
    }
A detection may either not find a charset, find an invalid charset, or find a valid charset
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-html-module/src/main/java/org/apache/tika/parser/html/charsetdetector/CharsetDetectionResult.java