From 6b6f68aa574083a2e0e87aad7e7ff44ddcb739cb Mon Sep 17 00:00:00 2001 From: Stefan Kolb Date: Sat, 24 Aug 2019 14:09:33 +0200 Subject: [PATCH] fix: use UTF-8 as default encoding for files ~ resolves #5133 If we create journal abbrev files via the JabRef, they are saved in UTF-8. So it makes sense to use this as default encoding. Also see https://github.com/JabRef/jabref/issues/5133. --- .../java/org/jabref/logic/journals/AbbreviationParser.java | 3 ++- .../org/jabref/logic/journals/JournalAbbreviationLoader.java | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/jabref/logic/journals/AbbreviationParser.java b/src/main/java/org/jabref/logic/journals/AbbreviationParser.java index 77d0483027fc..4892ea8b51a0 100644 --- a/src/main/java/org/jabref/logic/journals/AbbreviationParser.java +++ b/src/main/java/org/jabref/logic/journals/AbbreviationParser.java @@ -39,7 +39,8 @@ public void readJournalListFromResource(String resourceFileName) { } public void readJournalListFromFile(File file) throws FileNotFoundException { - try (FileReader reader = new FileReader(Objects.requireNonNull(file))) { + try (FileInputStream stream = new FileInputStream(Objects.requireNonNull(file)); + InputStreamReader reader = new InputStreamReader(stream, Objects.requireNonNull(StandardCharsets.UTF_8))) { readJournalList(reader); } catch (FileNotFoundException e) { throw e; diff --git a/src/main/java/org/jabref/logic/journals/JournalAbbreviationLoader.java b/src/main/java/org/jabref/logic/journals/JournalAbbreviationLoader.java index f1cde1f65b22..fce5ccc2b586 100644 --- a/src/main/java/org/jabref/logic/journals/JournalAbbreviationLoader.java +++ b/src/main/java/org/jabref/logic/journals/JournalAbbreviationLoader.java @@ -11,7 +11,6 @@ import org.slf4j.LoggerFactory; public class JournalAbbreviationLoader { - private static final Logger LOGGER = LoggerFactory.getLogger(JournalAbbreviationLoader.class); // journal initialization