From 70724d59acd4ad1aa2e07f698581df4a077d99b8 Mon Sep 17 00:00:00 2001 From: zserg Date: Wed, 27 Jan 2016 22:37:29 +0300 Subject: [PATCH] Accepted-language is set to English to prevent Unocode issues in the location response from openmapquest --- elodie/geolocation.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/elodie/geolocation.py b/elodie/geolocation.py index a615761..90da3e4 100644 --- a/elodie/geolocation.py +++ b/elodie/geolocation.py @@ -161,9 +161,10 @@ def reverse_lookup(lat, lon): try: params = {'format': 'json', 'key': key, 'lat': lat, 'lon': lon} + headers = {"Accept-Language": "en-US,en;q=0.5"} r = requests.get( 'http://open.mapquestapi.com/nominatim/v1/reverse.php?%s' % - urllib.urlencode(params) + urllib.urlencode(params),headers=headers ) return r.json() except requests.exceptions.RequestException as e: