Skip to content

Commit

Permalink
fix: use UTF-8 as default encoding for files ~ resolves #5133
Browse files Browse the repository at this point in the history
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 #5133.
  • Loading branch information
stefan-kolb committed Aug 24, 2019
1 parent 4477a13 commit f04a26e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;
Expand Down Expand Up @@ -39,7 +38,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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import org.slf4j.LoggerFactory;

public class JournalAbbreviationLoader {

private static final Logger LOGGER = LoggerFactory.getLogger(JournalAbbreviationLoader.class);

// journal initialization
Expand Down

0 comments on commit f04a26e

Please sign in to comment.