From 5ff210a80ae219d8cdd58608fd61b47b577d9772 Mon Sep 17 00:00:00 2001 From: Christoph Date: Sun, 25 Sep 2016 17:35:57 +0200 Subject: [PATCH] Medlineutf8 (#2061) * Add utf8 in medline * Add changelog entry --- CHANGELOG.md | 1 + .../net/sf/jabref/gui/importer/fetcher/MedlineFetcher.java | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 52a6f33ef843..a2b009825fba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -76,6 +76,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `# - Fixed [#1958](https://github.com/JabRef/jabref/issues/1958): Verbatim fields are no longer checked for HTML encoded characters by integrity checks - Fixed [#1937](https://github.com/JabRef/jabref/issues/1937): If no help page for the current chosen language exists, the english help page will be shown - Fixed [#1996](https://github.com/JabRef/jabref/issues/1996): Unnecessary other fields tab in entry editor removed (BibTeX mode) +- Fixed [#2060](https://github.com/JabRef/jabref/issues/2060): Medline fetcher now imports data in UTF-8 encoding ### Removed - Removed 2nd preview style diff --git a/src/main/java/net/sf/jabref/gui/importer/fetcher/MedlineFetcher.java b/src/main/java/net/sf/jabref/gui/importer/fetcher/MedlineFetcher.java index c0da745237c2..c76a8594a45a 100644 --- a/src/main/java/net/sf/jabref/gui/importer/fetcher/MedlineFetcher.java +++ b/src/main/java/net/sf/jabref/gui/importer/fetcher/MedlineFetcher.java @@ -6,6 +6,7 @@ import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.List; import java.util.regex.Matcher; @@ -224,7 +225,7 @@ private static List fetchMedline(String id, OutputPrinter status) { URL url = new URL(baseUrl); URLConnection data = url.openConnection(); ParserResult result = new MedlineImporter().importDatabase( - new BufferedReader(new InputStreamReader(data.getInputStream()))); + new BufferedReader(new InputStreamReader(data.getInputStream(), StandardCharsets.UTF_8))); if (result.hasWarnings()) { status.showMessage(result.getErrorMessage()); }