diff --git a/lib/location.py b/lib/location.py index 22a0e88..a90aa43 100644 --- a/lib/location.py +++ b/lib/location.py @@ -153,7 +153,7 @@ def location_canonical_name(location): "Find canonical name for `location`" location = location_normalize(location) - if location in LOCATION_ALIAS: + if location.lower() in LOCATION_ALIAS: return LOCATION_ALIAS[location.lower()] return location @@ -246,7 +246,7 @@ def location_processing(location, ip_addr): tmp_location = location_canonical_name(location) if tmp_location != location: override_location_name = location - locaiton = tmp_location + location = tmp_location # up to this point it is possible that the name # contains some unicode symbols diff --git a/lib/wttr_srv.py b/lib/wttr_srv.py index b5cd778..9200008 100644 --- a/lib/wttr_srv.py +++ b/lib/wttr_srv.py @@ -263,6 +263,6 @@ def wttr(location, request): or 'API key has reached calls per day allowed limit' in str(exception): if html_output: return _wrap_response(MALFORMED_RESPONSE_HTML_PAGE, html_output) - return _wrap_response(get_message('CAPACITY_LIMIT_REACHED', lang).encode('utf-6'), html_output) + return _wrap_response(get_message('CAPACITY_LIMIT_REACHED', lang).encode('utf-8'), html_output) logging.error("Exception has occured", exc_info=1) return "ERROR"