diff --git a/src/main/java/be/cylab/java/wowa/training/Utils.java b/src/main/java/be/cylab/java/wowa/training/Utils.java index d5a89263ae3b1348d43457ed2b39f06fe4798eb7..ced6a600378d7ac4248b591d08ca99a360b4f69c 100644 --- a/src/main/java/be/cylab/java/wowa/training/Utils.java +++ b/src/main/java/be/cylab/java/wowa/training/Utils.java @@ -8,6 +8,7 @@ import info.debatty.java.aggregation.WOWA; import org.apache.commons.lang3.ArrayUtils; import java.io.IOException; +import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Paths; import java.text.DateFormat; @@ -131,7 +132,8 @@ public final class Utils { throws IOException { Genson genson = new Genson(); - String data_json = new String(Files.readAllBytes(Paths.get(filename))); + String data_json = new String(Files.readAllBytes(Paths.get(filename)), + StandardCharsets.UTF_8); List<double[]> data = genson.deserialize( data_json, new GenericType<List<double[]>>() { @@ -151,7 +153,8 @@ public final class Utils { Genson genson = new Genson(); String expected_json = new String( - Files.readAllBytes(Paths.get(filename))); + Files.readAllBytes(Paths.get(filename)), + StandardCharsets.UTF_8); double[] expected = genson.deserialize(expected_json, double[].class); return expected; }