Skip to content

Commit

Permalink
Fix the encoding to UTF-8
Browse files Browse the repository at this point in the history
  • Loading branch information
Hans-Chrstian committed Jan 25, 2024
1 parent ed27ad8 commit 53c2a82
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ckanext/fairdatapoint/harvesters/domain/fair_data_point.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import logging
import requests
import encodings

from rdflib import Graph, URIRef
from rdflib.exceptions import ParserError
Expand Down Expand Up @@ -44,6 +45,7 @@ def _get_data(path: Union[str, URIRef]) -> Union[str, None]:
}
try:
response = requests.request("GET", path, headers=headers)
response.encoding = encodings.utf_8.getregentry().name
response.raise_for_status()
return response.text
except (HTTPError, ConnectionError, Timeout, RequestException) as e:
Expand Down

0 comments on commit 53c2a82

Please sign in to comment.