public boolean setCharset(String charset) {
   int ci = CharsetUtil.getIndex(charset);
   if (ci > 0) {
     this.charset = charset;
     this.charsetIndex = ci;
     return true;
   } else {
     return false;
   }
 }
 public boolean setCharsetIndex(int ci) {
   String charset = CharsetUtil.getCharset(ci);
   if (charset != null) {
     this.charset = charset;
     this.charsetIndex = ci;
     return true;
   } else {
     return false;
   }
 }