Skip to content

Commit 2788995

Browse files
committed
Merge pull request #34 from gEndelf/master
Fix response encoding (fixing #34)
2 parents 3090736 + 93ebc67 commit 2788995

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

overpass/api.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ def _GetFromOverpass(self, query):
8686
r = requests.post(
8787
self.endpoint,
8888
data=payload,
89-
timeout=self.timeout
89+
timeout=self.timeout,
90+
headers={'Accept-Charset': 'utf-8;q=0.7,*;q=0.7'}
9091
)
9192

9293
except requests.exceptions.Timeout:
@@ -103,6 +104,7 @@ def _GetFromOverpass(self, query):
103104
raise ServerLoadError(self._timeout)
104105
raise UnknownOverpassError("The request returned status code {code}".format(code = self._status))
105106
else:
107+
r.encoding = 'utf-8'
106108
return r.text
107109

108110
def _asGeoJSON(self, elements):

0 commit comments

Comments
 (0)