diff --git a/src/com/gpl/rpg/atcontentstudio/model/tools/i18n/PoPotWriter.java b/src/com/gpl/rpg/atcontentstudio/model/tools/i18n/PoPotWriter.java index 9a836e8..faee965 100644 --- a/src/com/gpl/rpg/atcontentstudio/model/tools/i18n/PoPotWriter.java +++ b/src/com/gpl/rpg/atcontentstudio/model/tools/i18n/PoPotWriter.java @@ -1,9 +1,12 @@ package com.gpl.rpg.atcontentstudio.model.tools.i18n; import java.io.File; +import java.io.FileOutputStream; import java.io.FileWriter; import java.io.IOException; +import java.io.OutputStreamWriter; import java.io.Writer; +import java.nio.charset.StandardCharsets; import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.List; @@ -17,7 +20,7 @@ public class PoPotWriter { public static void writePoFile(Map> stringsResources, Map translations, File destination) { try { - FileWriter fw = new FileWriter(destination); + Writer fw = new OutputStreamWriter(new FileOutputStream(destination), StandardCharsets.UTF_8); if (translations.get("") != null) { fw.write(translations.get("")); writeEndOfEntry(fw); diff --git a/src/net/launchpad/tobal/poparser/POParser.java b/src/net/launchpad/tobal/poparser/POParser.java index ec315f1..1fee0cc 100644 --- a/src/net/launchpad/tobal/poparser/POParser.java +++ b/src/net/launchpad/tobal/poparser/POParser.java @@ -12,6 +12,8 @@ import java.io.File; import java.io.FileReader; import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; import java.util.Vector; public class POParser @@ -60,11 +62,9 @@ private POFile parse(File file) POFile result = null; try { - FileReader fr = new FileReader(file); - BufferedReader br = new BufferedReader(fr); + BufferedReader br = Files.newBufferedReader(file.toPath(), StandardCharsets.UTF_8); result = parse(br); br.close(); - fr.close(); } catch (java.io.FileNotFoundException e) {