fix: write briefing files as utf-8
This commit is contained in:
+2
-2
@@ -216,7 +216,7 @@ def show_briefing(date: str = None) -> dict:
|
||||
if not path.exists():
|
||||
return {"status": "not_found", "message": f"No briefing found for {date}."}
|
||||
|
||||
with open(path) as f:
|
||||
with open(path, encoding="utf-8") as f:
|
||||
return json.load(f)
|
||||
|
||||
|
||||
@@ -225,7 +225,7 @@ def _save_briefing(data: dict, suffix: str = ""):
|
||||
BRIEFS_DIR.mkdir(parents=True, exist_ok=True)
|
||||
date = datetime.now().strftime("%Y-%m-%d")
|
||||
path = BRIEFS_DIR / f"{date}{suffix}.json"
|
||||
with open(path, "w") as f:
|
||||
with open(path, "w", encoding="utf-8") as f:
|
||||
json.dump(data, f, indent=2, default=str)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user