Skip to content
Snippets Groups Projects
Commit 4528c316 authored by Felipe Delestro Matos's avatar Felipe Delestro Matos
Browse files

hotfix for doi encoding

parent 60ff09e5
No related branches found
No related tags found
No related merge requests found
......@@ -38,7 +38,13 @@ def _make_request(doi, header):
def _log_and_get_text(doi, header):
response = _make_request(doi, header)
if response:
if response and response.encoding:
# Explicitly decode the response content using the specified encoding
text = response.content.decode(response.encoding)
log.info(text)
return text
elif response:
# If encoding is not specified, default to UTF-8
text = response.text
log.info(text)
return text
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment