Skip to content

Commit

Permalink
Use UTF-8 as default encoding for files (#5213)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-kolb authored and LinusDietz committed Aug 24, 2019
1 parent 2130e8e commit 7f02c70
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 7f02c70

Please sign in to comment.