@Override
 public void setContentType(String contentType) {
   this.contentType = contentType;
   if (contentType != null) {
     int charsetIndex = contentType.toLowerCase().indexOf(CHARSET_PREFIX);
     if (charsetIndex != -1) {
       String encoding = contentType.substring(charsetIndex + CHARSET_PREFIX.length());
       this.characterEncoding = encoding;
       this.charset = true;
     }
     updateContentTypeHeader();
   }
 }
 @Override
 public void setCharacterEncoding(String characterEncoding) {
   this.characterEncoding = characterEncoding;
   this.charset = true;
   updateContentTypeHeader();
 }