From 82e23416049420f8af5bfe2c700e6d0a703e8035 Mon Sep 17 00:00:00 2001 From: Martin Dieblich Date: Sat, 16 Jan 2021 17:02:17 +0100 Subject: [PATCH] enforce UTF-8 encoding during file output default encoding would've been chosen otherwise, which might be different --- src/main/java/net/vaemendis/hccd/CardGenerator.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/vaemendis/hccd/CardGenerator.java b/src/main/java/net/vaemendis/hccd/CardGenerator.java index 1b05a30..326fe91 100644 --- a/src/main/java/net/vaemendis/hccd/CardGenerator.java +++ b/src/main/java/net/vaemendis/hccd/CardGenerator.java @@ -20,6 +20,8 @@ public class CardGenerator { private static final String GENERATED_SUFFIX = "-GENERATED"; + private static final String ENCODING = "UTF-8"; + public static void generateCards(WatchedFiles projectFiles, UserConfiguration config) throws IOException { Hccd.log("Generating card sheet file..."); if (!projectFiles.getCsvFile().isFile()) { @@ -77,7 +79,7 @@ public static void generateCards(WatchedFiles projectFiles, UserConfiguration co } writeFooter(sb); - FileUtils.writeStringToFile(target, sb.toString()); + FileUtils.writeStringToFile(target, sb.toString(), ENCODING); Hccd.log("Card sheet file written to " + target.getPath()); } } @@ -86,7 +88,7 @@ private static void writeHeader(StringBuilder sb, String cssFilePath) { sb.append("" + "" + "" + - "" + + "" + "" + "" + "" +