force encoding

This commit is contained in:
Fabrice LAMANT
2026-02-04 23:02:20 +01:00
parent f77a37ca02
commit d0afdc430a
3 changed files with 3 additions and 3 deletions

View File

@ -27,6 +27,6 @@ export class Cache {
this.debug(`set: key=${key}`);
const path = this.cachePath(key);
mkdirSync(path.split("/").slice(0, -1).join("/"), { recursive: true });
writeFileSync(path, data);
writeFileSync(path, data, "utf-8");
}
}

View File

@ -119,7 +119,7 @@ export class ICSGenerator {
if (lines.length <= 10) {
this.debug("Skipping empty ICS file:", filepath);
} else {
writeFileSync(filepath, lines.join("\n"));
writeFileSync(filepath, lines.join("\n"), "utf-8");
}
}
}

View File

@ -70,7 +70,7 @@ export class Scraper {
private saveCalendar(): void {
this.debug("saveCalendar");
const calendar = this.getCalendar();
writeFileSync("./output/calendar.json", JSON.stringify(calendar, null, 2));
writeFileSync("./output/calendar.json", JSON.stringify(calendar, null, 2), "utf-8");
}
private async scrapeEvents(): Promise<void> {