public static boolean isValidIANAEncoding(String ianaEncoding) {
        if (ianaEncoding != null) {
            int length = ianaEncoding.length();
            if (length > 0) {
                char c = ianaEncoding.charAt(0);
                if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')) {
                    for (int i = 1; i < length; i++) {
                        c = ianaEncoding.charAt(i);
                        if ((c < 'A' || c > 'Z') && (c < 'a' || c > 'z') &&
                                (c < '0' || c > '9') && c != '.' && c != '_' &&
                                c != '-') {
                            return false;
                        }
                    }
                    return true;
                }
            }
        }
        return false;
    }
Returns true if the encoding name is a valid IANA encoding.
This method does not verify that there is a decoder available
for this encoding, only that the characters are valid for an
IANA encoding name.

@param ianaEncoding The IANA encoding name.
stroom-util/src/main/java/stroom/util/xml/XMLChar.java