Skip to content

Commit

Permalink
fix encoding error of city names with umlaut
Browse files Browse the repository at this point in the history
  • Loading branch information
seiferta committed Jun 9, 2016
1 parent 8b407ff commit 7027fe7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion emonitor/modules/maps/map_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def loadPositionOfCity(name):
:param name: name of city as string
:return: dict with cities sorted by name
"""
SEARCHSTRING = 'node["name"~"{}"]["place"~"town|village"];(._;>;);out;'.format(name) # search all cities with given name
SEARCHSTRING = 'node["name"~"{}"]["place"~"town|village"];(._;>;);out;'.format(name.encode('utf-8')) # search all cities with given name
r = requests.post('http://overpass-api.de/api/interpreter', data={'data': SEARCHSTRING})
cities = []
xmldoc = minidom.parseString(r.content)
Expand Down

0 comments on commit 7027fe7

Please sign in to comment.