ContentType ct = new ContentType(contentType);  if (!ct.getValue().matches(CT_TEXT_WILD)) throw new IllegalArgumentException("unsupported content type: " + contentType);  String charset = ct.getParameter(P_CHARSET);
String charset = new MimeCompoundHeader.ContentType(contentType).getParameter(P_CHARSET);
    public static String getCharset(String contentType) {        ContentType ct = new ContentType(contentType);        // we shouldn't get called with anything other then text/*, but if we do...        if (!ct.getValue().matches(CT_TEXT_WILD))            throw new IllegalArgumentException("unsupported content type: " + contentType);             String charset = ct.getParameter(P_CHARSET);        if (charset == null || charset.trim().equals(""))            charset = P_CHARSET_DEFAULT;        return charset;    }