rougier / persid

Persistent identifier library for GNU Emacs
GNU General Public License v3.0
35 stars 3 forks source link

Unexpected URL encoding #2

Closed yantar92 closed 1 year ago

yantar92 commented 1 year ago

I am trying

(persid-bibtex-from "https://doi.org/10.1016/j.jmst.2022.12.050")

and getting

"@article{Han_2023,
    doi = {10.1016/j.jmst.2022.12.050},
    url = {https://doi.org/10.1016%2Fj.jmst.2022.12.050},
    year = 2023,
    month = {jul},
    publisher = {Elsevier {BV}},
    volume = {152},
    pages = {237--246},
    author = {D.X. Han and G. Wang and Q. Wang and R. Feng and X.D. Ma and K.C. Chan and C.T. Liu},
    title = {Micro-scaled plastic yielding and shear-banding dynamics in metallic glasses},
    journal = {Journal of Materials Science {\\&}amp$\\mathsemicolon$ Technology}
}"

Note the url = {https://doi.org/10.1016%2Fj.jmst.2022.12.050}, with "/" encoded into %2F, which is unexpected.

yantar92 commented 1 year ago

Apparently it is exactly how things are returned from CrossRef. Yet another annoying malformatting from DOI records... I now "fixed" this using url-unhex-string for my usage.

rougier commented 1 year ago

Thanks for the report. Should I close the issue then?

yantar92 commented 1 year ago

"Nicolas P. Rougier" @.***> writes:

Thanks for the report. Should I close the issue then?

You may, or may not. Depending on what kind of functionality you want to provide.

This issue is an example of more general problem with BibTeX entries returned by CrossRef and other DOI info providers (note that doi.org itself has an official JSON API - see doi-utils.el from org-ref).

Some BibTeX returned by the API is simply malformed. Or contains HTML bits included (inappropriately). Or has missing fields. Or extra commas. Or garbage symbols like affiliation footnote marks (‡§, etc).

-- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92

rougier commented 1 year ago

fixing crossref entries might be beyond the scope of this library. Maybe we can only fix the most obvious errors.

yantar92 commented 1 year ago

"Nicolas P. Rougier" @.***> writes:

fixing crossref entries might be beyond the scope of this library. Maybe we can only fix the most obvious errors.

Then, feel free to close the issue.

-- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92