#include <stdio.h>
#include <libxml/parser.h>
#include <libxml/HTMLparser.h>
#include <libxml/encoding.h>


int
main (int argc, char **arg)
{
  const char data[] = "<!DOCTYPE htmlâ	</</body></html>";
  size_t size = sizeof (data);
  const char *buf = data;
  xmlCharEncoding enc = XML_CHAR_ENCODING_NONE;
  int bomlen;
  htmlParserCtxtPtr ctxt;

  size -= 4;

  bomlen = 0;
  ctxt = htmlCreatePushParserCtxt (
				   NULL, NULL, (char const *)(buf + bomlen),
				   4 - bomlen, "/dev/null", enc);
  buf += 4;

  htmlParseChunk (ctxt, (char const *)buf, size, 0);

  htmlParseChunk (ctxt, (char const *)buf, 0, 1);

  return 0;
}
