CharCursor cursor = new StringCharCursor(content);
charsetScanner.scan(cursor);
charsetScanner.skip(cursor);
CharBuffer buf = CharBuffer.allocate();
while (cursor.current() != cursor.DONE) {
buf.clear();
charsetScanner.scan(cursor, buf);
if (buf.toString().equalsIgnoreCase("charset")) {
charsetScanner.skip(cursor);
buf.clear();