From a5b3f96dfc849665a8be541ed098f679dcb564cd Mon Sep 17 00:00:00 2001 From: Rahman Usta Date: Sun, 26 Aug 2018 15:43:54 +0200 Subject: [PATCH] Default charset UTF-8 --- src/main/java/com/kodedu/other/IOHelper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/kodedu/other/IOHelper.java b/src/main/java/com/kodedu/other/IOHelper.java index 5607f7e6e..1c3308aa6 100644 --- a/src/main/java/com/kodedu/other/IOHelper.java +++ b/src/main/java/com/kodedu/other/IOHelper.java @@ -46,7 +46,7 @@ public class IOHelper { private static final Map pathCharsetMap = new LRUMap(); public static Optional writeToFile(Path path, String content, StandardOpenOption... openOption) { - String charset = pathCharsetMap.get(path); + String charset = pathCharsetMap.getOrDefault(path, "UTF-8"); try (Writer out = new BufferedWriter(new OutputStreamWriter(Files.newOutputStream(path, openOption), charset)); ) {