@Test
public void testUTF8Text() throws Exception {

    String text = "I\u00F1t\u00EBrn\u00E2ti\u00F4n\u00E0liz\u00E6ti\u00F8n";
    ContentHandler handler = new BodyContentHandler();
    Metadata metadata = new Metadata();
    parser.parse(
            new ByteArrayInputStream(text.getBytes(UTF_8)),
            handler, metadata, new ParseContext());
    assertEquals("text/plain; charset=UTF-8", metadata.get(Metadata.CONTENT_TYPE));
    assertEquals("UTF-8", metadata.get(Metadata.CONTENT_ENCODING)); // deprecated
    TikaTest.assertContains(text, handler.toString());
}