Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unicode conversion bibtexkey #2720

Merged
merged 3 commits into from
Apr 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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