Update app.py
Browse files
app.py
CHANGED
|
@@ -77,7 +77,7 @@ def load_data(file_path, default_data=None):
|
|
| 77 |
try:
|
| 78 |
with open(file_path, "r", encoding="utf-8") as f:
|
| 79 |
data = json.load(f)
|
| 80 |
-
|
| 81 |
if isinstance(default_data, list):
|
| 82 |
if isinstance(data, list):
|
| 83 |
return data
|
|
@@ -102,7 +102,7 @@ def save_data(file_path, data):
|
|
| 102 |
"""Saves dictionary or list as JSON (Used for history in this version)."""
|
| 103 |
try:
|
| 104 |
with open(file_path, "w", encoding="utf-8") as f:
|
| 105 |
-
json.dump(data, f, indent=4)
|
| 106 |
except IOError as e:
|
| 107 |
print(f"Error saving {file_path}: {e}")
|
| 108 |
|
|
|
|
| 77 |
try:
|
| 78 |
with open(file_path, "r", encoding="utf-8") as f:
|
| 79 |
data = json.load(f)
|
| 80 |
+
it
|
| 81 |
if isinstance(default_data, list):
|
| 82 |
if isinstance(data, list):
|
| 83 |
return data
|
|
|
|
| 102 |
"""Saves dictionary or list as JSON (Used for history in this version)."""
|
| 103 |
try:
|
| 104 |
with open(file_path, "w", encoding="utf-8") as f:
|
| 105 |
+
json.dump(data, f, indent=4, ensure_ascii=False)
|
| 106 |
except IOError as e:
|
| 107 |
print(f"Error saving {file_path}: {e}")
|
| 108 |
|