private void writeSelectHeadersInBody(Metadata metadata, MAPIMessage msg, XHTMLContentHandler xhtml)
            throws SAXException, ChunkNotFoundException {
        if (! officeParserConfig.isWriteSelectHeadersInBody()) {
            return;
        }
        String subject = metadata.get(TikaCoreProperties.TITLE);
        subject = (subject == null) ? "" : subject;
        xhtml.element("h1", subject);

        // Output the from and to details in text, as you
        //  often want them in text form for searching
        xhtml.startElement("dl");
        String from = metadata.get(Message.MESSAGE_FROM);
        if (from != null) {
            header(xhtml, "From", from);
        }
        header(xhtml, "To", msg.getDisplayTo());
        header(xhtml, "Cc", msg.getDisplayCC());
        header(xhtml, "Bcc", msg.getDisplayBCC());
        try {
            header(xhtml, "Recipients", msg.getRecipientEmailAddress());
        } catch (ChunkNotFoundException e) {
            //swallow
        }
        xhtml.endElement("dl");
    }
Tries to identify the correct encoding for 7-bit (non-unicode)
strings in the file.
<p>Many messages store their strings as unicode, which is
nice and easy. Some use one-byte encodings for their
strings, but don't always store the encoding anywhere
helpful in the file.</p>
<p>This method checks for codepage properties, and failing that
looks at the headers for the message, and uses these to
guess the correct encoding for your file.</p>
<p>Bug #49441 has more on why this is needed</p>
<p>This is taken verbatim from POI (TIKA-1238)
as a temporary workaround to prevent unsupported encoding exceptions</p>
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-microsoft-module/src/main/java/org/apache/tika/parser/microsoft/OutlookExtractor.java