Search in sources :

Example 1 with HtmlEncodingDetector

use of org.apache.tika.parser.html.HtmlEncodingDetector in project tika by apache.

the class TikaEncodingDetectorTest method testDefault.

@Test
public void testDefault() {
    EncodingDetector detector = TikaConfig.getDefaultConfig().getEncodingDetector();
    assertTrue(detector instanceof CompositeEncodingDetector);
    List<EncodingDetector> detectors = ((CompositeEncodingDetector) detector).getDetectors();
    assertEquals(3, detectors.size());
    assertTrue(detectors.get(0) instanceof HtmlEncodingDetector);
    assertTrue(detectors.get(1) instanceof UniversalEncodingDetector);
    assertTrue(detectors.get(2) instanceof Icu4jEncodingDetector);
}
Also used : Icu4jEncodingDetector(org.apache.tika.parser.txt.Icu4jEncodingDetector) NonDetectingEncodingDetector(org.apache.tika.detect.NonDetectingEncodingDetector) UniversalEncodingDetector(org.apache.tika.parser.txt.UniversalEncodingDetector) CompositeEncodingDetector(org.apache.tika.detect.CompositeEncodingDetector) EncodingDetector(org.apache.tika.detect.EncodingDetector) HtmlEncodingDetector(org.apache.tika.parser.html.HtmlEncodingDetector) CompositeEncodingDetector(org.apache.tika.detect.CompositeEncodingDetector) UniversalEncodingDetector(org.apache.tika.parser.txt.UniversalEncodingDetector) Icu4jEncodingDetector(org.apache.tika.parser.txt.Icu4jEncodingDetector) HtmlEncodingDetector(org.apache.tika.parser.html.HtmlEncodingDetector) Test(org.junit.Test)

Aggregations

CompositeEncodingDetector (org.apache.tika.detect.CompositeEncodingDetector)1 EncodingDetector (org.apache.tika.detect.EncodingDetector)1 NonDetectingEncodingDetector (org.apache.tika.detect.NonDetectingEncodingDetector)1 HtmlEncodingDetector (org.apache.tika.parser.html.HtmlEncodingDetector)1 Icu4jEncodingDetector (org.apache.tika.parser.txt.Icu4jEncodingDetector)1 UniversalEncodingDetector (org.apache.tika.parser.txt.UniversalEncodingDetector)1 Test (org.junit.Test)1