Skip to content

Commit

Permalink
Unicode conversion bibtexkey (#2720)
Browse files Browse the repository at this point in the history
* Avoid unicode conversion for the key field in the main table

* Avoid unicode conversion for key field internally

* Fix changelog entry
  • Loading branch information
lenhard authored and tobiasdiez committed Apr 8, 2017
1 parent c2fe388 commit 0c88693
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- Improved author handling in MS-Office Import/Export
- The `day` part of the biblatex `date` field is now exported to the corresponding `day` field in MS-Office XML. [#2691](https://github.com/JabRef/jabref/issues/2691)
- Single underscores are not converted during the LaTeX to unicode conversion, which does not follow the rules of LaTeX, but is what users require. [#2664](https://github.com/JabRef/jabref/issues/2664)
- The bibtexkey field is not converted to unicode

### Fixed
- We fixed an issue of duplicate keys after using a fetcher, e.g., DOI or ISBN [#2867](https://github.com/JabRef/jabref/issues/2687)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public Object getColumnValue(BibEntry entry) {
result = toUnicode.format(MainTableNameFormatter.formatName(result));
}

if (result != null) {
if (result != null && !BibEntry.KEY_FIELD.equals(columnName)) {
result = toUnicode.format(result).trim();
}

Expand Down
5 changes: 5 additions & 0 deletions src/main/java/org/jabref/model/entry/BibEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,11 @@ public Optional<String> getLatexFreeField(String name) {
return Optional.empty();
} else if (latexFreeFields.containsKey(name)) {
return Optional.ofNullable(latexFreeFields.get(toLowerCase(name)));
} else if (KEY_FIELD.equals(name)) {
// the key field should not be converted
Optional<String> citeKey = getCiteKeyOptional();
latexFreeFields.put(name, citeKey.get());
return citeKey;
} else {
String latexFreeField = LatexToUnicodeAdapter.format(getField(name).get()).intern();
latexFreeFields.put(name, latexFreeField);
Expand Down

0 comments on commit 0c88693

Please sign in to comment.