code: private String getEncoding(final String contentType) {
          if (contentType == null || !contentType.contains(CHARSET)) {
              return DEFAULT_ENCODING;
          }
          String encoding = null;
          try {
              encoding = contentType.substring(contentType.indexOf(CHARSET) + CHARSET.length());
              encoding = encoding.toLowerCase().replaceAll("\"", "");
          } catch (Exception e) {
              //Extraction from the string failed.
          }
          if (!validEncodings.contains(encoding)) {
              LOGGER.warn("Invalid Encoding '{}' - using default - '{}'", encoding, DEFAULT_ENCODING);
              encoding = DEFAULT_ENCODING;
          }
          return encoding;
      }
docs: EG: Content-Type: text/html; charset=utf-8