read and write po files using utf 8 encoding

until now the system default was used, which is especially on windows not utf 8
This commit is contained in:
Gonk
2019-09-04 23:33:41 +02:00
parent ac68006a69
commit 7297f47b67
2 changed files with 7 additions and 4 deletions

View File

@@ -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<String, List<String>> stringsResources, Map<String, String> 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);