@Test
public void testHttpEquivCharsetFunkyAttributes() throws Exception {

    String test1 =
            "<html><head><meta http-equiv=\"content-type\""
                    + " content=\"text/html; charset=ISO-8859-15; charset=iso-8859-15\" />"
                    + "<title>the name is \u00e1ndre</title>"
                    + "</head><body></body></html>";
    Metadata metadata = new Metadata();
    new HtmlParser().parse(
            new ByteArrayInputStream(test1.getBytes(ISO_8859_1)),
            new BodyContentHandler(), metadata, new ParseContext());
    assertEquals("ISO-8859-15", metadata.get(Metadata.CONTENT_ENCODING));
    // Some HTML pages have errors like ';;' versus '; ' as separator
    String test2 =
            "<html><head><meta http-equiv=\"content-type\""
                    + " content=\"text/html;;charset=ISO-8859-15\" />"
                    + "<title>the name is \u00e1ndre</title>"
                    + "</head><body></body></html>";
    metadata = new Metadata();
    new HtmlParser().parse(
            new ByteArrayInputStream(test2.getBytes(ISO_8859_1)),
            new BodyContentHandler(), metadata, new ParseContext());
    assertEquals("ISO-8859-15", metadata.get(Metadata.CONTENT_ENCODING));
}