code: protected Charset setContentType(MediaType mediaType, MultivaluedMap<String, Object> httpHeaders) {
          String charset = mediaType.getParameters().get("charset");
          Charset encoding;
          MediaType finalMediaType;
          if (charset == null) {
              encoding = this.getEncoding();
              HashMap<String, String> typeList = Maps.newHashMap(mediaType.getParameters());
              typeList.put("charset", encoding.name());
              finalMediaType = new MediaType(mediaType.getType(), mediaType.getSubtype(), typeList);
          } else {
              try {
                  encoding = Charset.forName(charset);
              } catch (Exception e) {
                  encoding = Charsets.UTF_8;
              }
              finalMediaType = mediaType;
          }
  
          List<Object> typeList = Lists.newArrayListWithCapacity(1);
          typeList.add(finalMediaType.toString());
          httpHeaders.put("Content-Type", typeList);
          return encoding;
      }
docs: <p>setContentType.</p>
  
  @param mediaType   a {@link javax.ws.rs.core.MediaType} object.
  @param httpHeaders a {@link javax.ws.rs.core.MultivaluedMap} object.
  @return a {@link java.nio.charset.Charset} object.
  @since 0.1.6e