JabRef / JabRef-Browser-Extension

Browser extension for JabRef to allow importing of new items directly from the browser.
https://www.jabref.org/
GNU Affero General Public License v3.0
83 stars 22 forks source link

UTF-8-formatted characters in references are mangled by JabFox on Mac #33

Closed RKBK closed 8 years ago

RKBK commented 8 years ago

Importing the following reference http://www.sciencedirect.com/science/article/pii/S0378775314018175 with JabFox to Jabref 3.3 on Mac OS X El capitan mangles the format of the author names.

After import, the reference look like this in JabRef:

Article (hormann_challenges_2015) 
Hörmann, N. G.; Jäckle, M.; Gossenberger, F.; Roman, T.; Forster-Tonigold, K.; Naderian, M.; Sakong, S. & Groß, A. 
Some challenges in the first-principles modeling of structures and processes in electrochemical energy storage and transfer 
Journal of Power Sources, 2015, 275, 531-53
tobiasdiez commented 8 years ago

Mhh... I just tried it on Windows with JabRef 3.5 and the umlauts are imported correctly. Could you please try if updating JabRef fixes the problem? Thanks.

RKBK commented 8 years ago

Updating to JabRef 3.6 (latest available in homebrew) unfortunately did not fix the problem. I'm not sure if it is related to JabFox, JabRef, or even to the internal formatting in Mac OSX. I will note that formatting in Zotero (if I just save the same page to zotero) is just fine.

tobiasdiez commented 8 years ago

Ok, lets figure out if it is a problem with the JabFox / zotero export or with JabRef. Since I have no access to a Mac, I need your assistance. After detecting the bibliographic information on the website, JabFox exports the information to a .bib file in the temporary folder (I think this is /tmp on Mac OS). In there should be a file called zotero_export-X.bib (with X being a number). So for me on Windows the complete path is C:\Users\Tobi\AppData\Local\Temp\zotero_export-2.bib. Could you please locate the corresponding bib file and paste the content here? Thanks.

RKBK commented 8 years ago

After a bunch of digging around, I found the zotero-export.bib files in ~/Library/Caches/TemporaryItems/

These are the contents (apparently with correctly encoded characters!)

@article{hormann_challenges_2015,
        title = {Some challenges in the first-principles modeling of structures and processes in electrochemical energy storage and transfer},
        volume = {275},
        issn = {0378-7753},
        url = {http://www.sciencedirect.com/science/article/pii/S0378775314018175},
        doi = {10.1016/j.jpowsour.2014.10.198},
        abstract = {In spite of the strong relevance of electrochemical energy conversion and storage, the atomistic modeling of structures and processes in electrochemical syste\
ms from first principles is hampered by severe problems. Among others, these problems are associated with the theoretical description of the electrode potential, the characteriza\
tion of interfaces, the proper treatment of liquid electrolytes, changes in the bulk structure of battery electrodes, and limitations of the functionals used in first-principles \
electronic structure calculations. We will illustrate these obstacles, but also indicate strategies to overcome them.},
        urldate = {2016-09-17},
        journal = {Journal of Power Sources},
        author = {Hörmann, Nicolas G. and Jäckle, Markus and Gossenberger, Florian and Roman, Tanglaw and Forster-Tonigold, Katrin and Naderian, Maryam and Sakong, Sung and Groß,\
 Axel},
        month = feb,
        year = {2015},
        keywords = {Batteries, Charging/discharging, Computer simulations, Dendrite growth, Density functional calculations, Electrode-electrolyte interfaces},
        pages = {531--538},
        file = {ScienceDirect Full Text PDF:/Users/rasmusk/Library/Application Support/Firefox/Profiles/0gq57lj2.default/zotero/storage/DN2QGHXV/Hörmann et al. - 2015 - Some chal\
lenges in the first-principles modeling o.pdf:application/pdf}
}

That's a bit strange! My database encoding is UTF-8 (obviously, since I can rewrite the names to use the correct characters), so I was guessing everything would be OK on the JabRef side.

tobiasdiez commented 8 years ago

Can you also double-check that the default encoding under Preferences -> General -> Default encoding is UTF-8.

RKBK commented 8 years ago

Changing the default encoding to UTF-8, restarting Jabref, and retrieving the reference with JabFox now maintains the correct encoding! That fixed it. Thank you!

It should have been an obvious fix, but I assumed that since the database is UTF-8-encoded, everything should be handled correctly regardless. However, I assume that JabRef uses the default encoding in the program itself when importing, and does not check the .bib file it currently has open.

tobiasdiez commented 8 years ago

Glad that your problem is fixed. Thanks for the feedback.

I fully agree with you that the encoding business is not as clear as it could be. I opened a new issue https://github.com/JabRef/jabref/issues/2013 to discuss this. Feel free to contribute to the discussion there.