code: public static Charset fromMediaType(String mediaType) {
        if (mediaType == null) return null;
        int indexOfCharset = mediaType.indexOf(CHARSET_HEADER);
        if (indexOfCharset != -1) {
           try {
              return new Charset(mediaType.substring(indexOfCharset + CHARSET_HEADER.length()));
           } catch (Exception e) {
              logger.trace("Unrecognized charset from media type " + mediaType, e);
           }
        }
        return null;
     }
docs: Creates {@link Charset} based on {@link org.infinispan.commons.dataconversion.MediaType} as string.
  
  @param mediaType {@link org.infinispan.commons.dataconversion.MediaType} value.
  @return Returns {@link Charset} value or <code>null</code> if charset is not supported.