Merge branch 'pofileencoding' into jar20200121

This commit is contained in:
Gonk
2020-01-21 22:21:58 +01:00
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);

View File

@@ -12,6 +12,8 @@ import java.io.BufferedReader;
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 @@ public class POParser
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)
{