From 008cb94f9687c25110c6d1b2513ddab7e79c34cc Mon Sep 17 00:00:00 2001 From: Andrei Kliuchnikau Date: Mon, 5 Aug 2024 11:25:03 +0300 Subject: [PATCH] Use UTF-8 encoding when reading multilingual JSON templates --- .../src/main/java/guru/qa/allure/notifications/json/JSON.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/allure-notifications-api/src/main/java/guru/qa/allure/notifications/json/JSON.java b/allure-notifications-api/src/main/java/guru/qa/allure/notifications/json/JSON.java index bc2f03cc..b9ab434e 100644 --- a/allure-notifications-api/src/main/java/guru/qa/allure/notifications/json/JSON.java +++ b/allure-notifications-api/src/main/java/guru/qa/allure/notifications/json/JSON.java @@ -12,6 +12,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; /** * @author kadehar @@ -36,7 +37,7 @@ public T parseFile(File file, Class clazz) throws FileNotFoundException { public T parseResource(String resourcePath, Class clazz) throws IOException { log.info("Mapping resource at path {} to {} object", resourcePath, clazz.getSimpleName()); try (InputStream inputStream = RESOURCES_UTIL.getResourceAsStream(resourcePath); - InputStreamReader inputStreamReader = new InputStreamReader(inputStream)) { + InputStreamReader inputStreamReader = new InputStreamReader(inputStream, StandardCharsets.UTF_8)) { return GSON.fromJson(inputStreamReader, clazz); } }