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

@@ -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)
{