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