Skip to content

Commit fc61bc3

Browse files
committed
Merge pull request #34 from bquistorff/master
Fix encoding for DOI import
2 parents 1986f9f + a352170 commit fc61bc3

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[master]
2+
- Fix for bug 1213 (sourceforge): Fix encoding for DOI import
23
- Feature #809: import pubmed central id (pmc) field from medline
34
- Fix undoing Cleanup/Convert to Biblatex
45
- Adapted pattern to parse DBLP entries

src/main/java/net/sf/jabref/imports/DOItoBibTeXFetcher.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (C) 2012 JabRef contributors.
1+
/* Copyright (C) 2014 JabRef contributors.
22
This program is free software: you can redistribute it and/or modify
33
it under the terms of the GNU General Public License as published by
44
the Free Software Foundation, either version 3 of the License, or
@@ -119,7 +119,7 @@ public BibtexEntry getEntryFromDOI(String doi, OutputPrinter status) {
119119

120120
String bibtexString;
121121
try {
122-
bibtexString = Util.getResults(conn);
122+
bibtexString = Util.getResultsWithEncoding(conn, "UTF8");
123123
} catch (FileNotFoundException e) {
124124

125125
if (status != null) {
@@ -134,7 +134,9 @@ public BibtexEntry getEntryFromDOI(String doi, OutputPrinter status) {
134134
}
135135

136136

137-
137+
//Usually includes an en-dash in the page range. Char is in cp1252 but not
138+
// ISO 8859-1 (which is what latex expects). For convenience replace here.
139+
bibtexString = bibtexString.replaceAll("(pages=\\{[0-9]+)\u2013([0-9]+\\})", "$1--$2");
138140
BibtexEntry entry = BibtexParser.singleFromString(bibtexString);
139141

140142
if (entry != null) {

src/main/resources/help/About.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ <h2>Contributions from:</h2>
8383
Alex Montgomery,
8484
Saverio Mori,
8585
Ambrogio Oliva,
86+
Brian Quistorff,
8687
Stephan Rave,
8788
John Relph,
8889
Hannes Restel,

0 commit comments

Comments
 (0)