private Charset findCharset(final byte[] codedCharset) {
        final String codedCharsetString = new String(codedCharset, StandardCharsets.ISO_8859_1);
        try {
            if (Charset.isSupported(codedCharsetString)) {
                return Charset.forName(codedCharsetString);
            }
        } catch (final IllegalArgumentException ignored) {
            // ignored
        }
        // check if encoding is a escape sequence
        // normalize encoding byte sequence
        final byte[] codedCharsetNormalized = Allocator.byteArray(codedCharset.length);
        int j = 0;
        for (final byte element : codedCharset) {
            if (element != ' ') {
                codedCharsetNormalized[j++] = element;
            }
        }

        if (Arrays.equals(codedCharsetNormalized, CHARACTER_ESCAPE_SEQUENCE)) {
            return StandardCharsets.UTF_8;
        }
        return DEFAULT_CHARSET;
    }
Constructs a new instance with the default, big-endian, byte order.
src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcParser.java