public CharsetDetector setDeclaredEncoding(String encoding) {
        setCanonicalDeclaredEncoding(encoding);
        return this;
    }
Set the declared encoding for charset detection.
The declared encoding of an input text is an encoding obtained
from an http header or xml declaration or similar source that
can be provided as additional information to the charset detector.
A match between a declared encoding and a possible detected encoding
will raise the quality of that detected encoding by a small delta,
and will also appear as a "reason" for the match.
<p>
A declared encoding that is incompatible with the input data being
analyzed will not be added to the list of possible encodings.

@param encoding The declared encoding
@stable ICU 3.4
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-text-module/src/main/java/org/apache/tika/parser/txt/CharsetDetector.java