From 3d524349a11f8af5142b00f6fc67b5294682be66 Mon Sep 17 00:00:00 2001 From: dburbrid Date: Mon, 26 Jun 2023 09:33:03 +0100 Subject: [PATCH] Correction of bug when compiling/testing on Windows: Issue537 file must be read as UTF-8 (Issue 745) --- src/test/java/org/json/junit/XMLTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/json/junit/XMLTest.java b/src/test/java/org/json/junit/XMLTest.java index aefaa49da..e940032e0 100644 --- a/src/test/java/org/json/junit/XMLTest.java +++ b/src/test/java/org/json/junit/XMLTest.java @@ -18,6 +18,7 @@ import java.io.InputStreamReader; import java.io.Reader; import java.io.StringReader; +import java.nio.charset.Charset; import java.util.HashMap; import java.util.Map; @@ -915,7 +916,7 @@ public void testIssue537CaseSensitiveHexEscapeFullFile(){ InputStream xmlStream = null; try { xmlStream = XMLTest.class.getClassLoader().getResourceAsStream("Issue537.xml"); - Reader xmlReader = new InputStreamReader(xmlStream); + Reader xmlReader = new InputStreamReader(xmlStream, Charset.forName("UTF-8")); JSONObject actual = XML.toJSONObject(xmlReader, true); InputStream jsonStream = null; try {