Skip to content

Commit

Permalink
Default charset UTF-8
Browse files Browse the repository at this point in the history
  • Loading branch information
rahmanusta committed Aug 26, 2018
1 parent c37a486 commit a5b3f96
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/com/kodedu/other/IOHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class IOHelper {
private static final Map<Path, String> pathCharsetMap = new LRUMap();

public static Optional<Exception> 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));
) {
Expand Down

0 comments on commit a5b3f96

Please sign in to comment.