You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tika.apache.org by ta...@apache.org on 2018/08/03 16:18:42 UTC

[tika] branch master updated: TIKA-2673 -- fix forbidden-apis failures

This is an automated email from the ASF dual-hosted git repository.

tallison pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tika.git


The following commit(s) were added to refs/heads/master by this push:
     new f8a8447  TIKA-2673 -- fix forbidden-apis failures
f8a8447 is described below

commit f8a8447550afcff941700375774ad3cb92db4d8b
Author: TALLISON <ta...@apache.org>
AuthorDate: Fri Aug 3 12:17:33 2018 -0400

    TIKA-2673 -- fix forbidden-apis failures
---
 .../org/apache/tika/parser/html/StandardHtmlEncodingDetectorTest.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tika-parsers/src/test/java/org/apache/tika/parser/html/StandardHtmlEncodingDetectorTest.java b/tika-parsers/src/test/java/org/apache/tika/parser/html/StandardHtmlEncodingDetectorTest.java
index f515285..38d351f 100644
--- a/tika-parsers/src/test/java/org/apache/tika/parser/html/StandardHtmlEncodingDetectorTest.java
+++ b/tika-parsers/src/test/java/org/apache/tika/parser/html/StandardHtmlEncodingDetectorTest.java
@@ -136,7 +136,7 @@ public class StandardHtmlEncodingDetectorTest {
     @Test
     public void tooLong() throws IOException {
         // Create a string with 1Mb of '\0' followed by a meta
-        String padded = new String(new byte[1000000]) + "<meta charset='windows-1252'>";
+        String padded = new String(new byte[1000000], StandardCharsets.ISO_8859_1) + "<meta charset='windows-1252'>";
         // Only the first bytes should be prescanned, so the algorithm should stop before the meta tag
         assertCharset(padded, null);
     }
@@ -172,7 +172,7 @@ public class StandardHtmlEncodingDetectorTest {
     public void replacement() throws IOException {
         // Several dangerous charsets should are aliases of 'replacement' in the spec
         String inString = "<meta charset='iso-2022-cn'>";
-        assertCharset(new ByteArrayInputStream(inString.getBytes()), new ReplacementCharset());
+        assertCharset(new ByteArrayInputStream(inString.getBytes(StandardCharsets.ISO_8859_1)), new ReplacementCharset());
     }
 
     @Test