private static Charset getCharsetByName(String charsetName) throws RequestException {
        try {
            return Charset.forName(charsetName);
        } catch (IllegalCharsetNameException | UnsupportedCharsetException e) {
            throw new RequestException(UNSUPPORTED_MEDIA_TYPE, "Unsupported charset " + charsetName, e);
        }
    }
Looks up a Charset given a charset name.

@param charsetName the name of the charset to look up
@return a valid Charset for the charset name (never returns null)
@throws RequestException if the charset name is invalid or unsupported
container-core/src/main/java/com/yahoo/jdisc/http/server/jetty/FormPostRequestHandler.java