Skip to content

Commit

Permalink
Add workaround for files loaded with wrong encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
jnettels committed Jun 14, 2023
1 parent e45de20 commit f2c5afd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lpagg/weather_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,9 @@ def get_TRNSYS_coordinates(weather_file_path):
if match:
dict_match = match.groupdict()
for key, val in match.groupdict().items():
deg, minutes, seconds = re.split('[°\']', val)
# When the file is loaded with a wrong enconding,
# a string like val="53°32'" may become val="53°32'"
deg, minutes, seconds = re.split('Â?°|\'', val)
coord = float(deg) + float(minutes)/60
dict_match[key] = coord
url = 'http://epsg.io/trans?s_srs=4326&t_srs=4326'
Expand Down

0 comments on commit f2c5afd

Please sign in to comment.