@Test
public void testExtractHTTPHeaderCharset()
        throws Exception
{

    String httpHeaders = "HTTP/1.1 200 OK\n" + "Date: Sun, 05 Jul 2015 17:30:02 GMT\n"
            + "Server: Apache/2.2.29 (Unix) FrontPage/5.0.2.2635\n"
            + "X-Powered-By: PHP/5.3.29-pl0-gentoo\n"
            + "X-Pingback: http://0351de3.netsolhost.com/WordPress/xmlrpc.php\n"
            + "Link: <http://0351de3.netsolhost.com/WordPress/?p=8261>; rel=shortlink\n"
            + "Connection: close\n" + "Content-Type: text/html; charset= UTF-8\n";
    assertEquals("utf-8", WARCRecord.extractHTTPHeaderCharset(httpHeaders));
    httpHeaders = "HTTP/1.1 200 OK\n" + "Date: Sun, 05 Jul 2015 17:30:02 GMT\n"
            + "Server: Apache/2.2.29 (Unix) FrontPage/5.0.2.2635\n"
            + "X-Powered-By: PHP/5.3.29-pl0-gentoo\n"
            + "X-Pingback: http://0351de3.netsolhost.com/WordPress/xmlrpc.php\n"
            + "Link: <http://0351de3.netsolhost.com/WordPress/?p=8261>; rel=shortlink\n"
            + "Connection: close\n" + "Content-Type: text/html; charset=charset=ISO-8859-4";
    assertEquals("iso-8859-4", WARCRecord.extractHTTPHeaderCharset(httpHeaders));
}