Skip to content
Snippets Groups Projects
Commit 1dc90b8c authored by Sara Savanovic Djordjevic's avatar Sara Savanovic Djordjevic
Browse files

fix: 'ø' character encoding in files

parent 182c8110
No related branches found
No related tags found
1 merge request!16Clhp map into main
......@@ -188,16 +188,17 @@ def write_json_to_file(lake_name: str, map_data: dict):
json.dump(map_data, f)
# Read all_system_lakes.json
with open(LAKE_RELATIONS_PATH + 'all_lake_names.json', 'r') as file:
data = json.load(file)
with open(LAKE_RELATIONS_PATH + 'all_lake_names.json', 'r', encoding='utf-8') as f:
data = json.load(f)
# Check if the lake name exists in the list
if lake_name not in data:
data.append(lake_name) # Only append to list if it does not already exist
# Update all_lake_names.json with new lake name
with open(LAKE_RELATIONS_PATH + 'all_lake_names.json', 'w') as file:
json.dump(data, file, ensure_ascii=False, indent=2)
with open(LAKE_RELATIONS_PATH + 'all_lake_names.json', 'w', encoding='utf-8') as f:
json.dump(data, f, ensure_ascii=False, indent=2)
# Plotting the map can take a considerable amount of time, especially when creating maps with many
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment