@Test
public void testDetectOfCharset() throws Exception {

    String test =
            "<html><head><title>\u017d</title></head><body></body></html>";
    Metadata metadata = new Metadata();
    new HtmlParser().parse(
            new ByteArrayInputStream(test.getBytes(UTF_8)),
            new BodyContentHandler(), metadata, new ParseContext());
    assertEquals("\u017d", metadata.get(TikaCoreProperties.TITLE));
}