private String extractText(byte[] data, boolean trim) throws TikaException {
        // The text is always stored null terminated, but sometimes
        //  may have extra null padding too
        int length = data.length - 1;
        if (trim) {
            for (int i = 0; i < data.length; i++) {
                if (data[i] == 0) {
                    length = i;
                    break;
                }
            }
        }

        // We believe that the text is basically stored as CP437
        // That said, there are a few characters slightly wrong for that...
        String text;
        try {
            text = new String(data, 0, length, "cp437");
        } catch (UnsupportedEncodingException e) {
            throw new TikaException("JVM Broken, core codepage CP437 missing!");
        }

        // Fix up the known character issues
        text = text.replace("\u03C6", "\u00D8");

        // All done, as best as we can!
        return text;
    }
Does our best to turn the bytes into text
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-cad-module/src/main/java/org/apache/tika/parser/prt/PRTParser.java