diff --git a/scraper/cache.ts b/scraper/cache.ts index 3f6c26390..ab4160df0 100644 --- a/scraper/cache.ts +++ b/scraper/cache.ts @@ -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"); } } diff --git a/scraper/ics-generator.ts b/scraper/ics-generator.ts index abd388dd2..c2c051826 100644 --- a/scraper/ics-generator.ts +++ b/scraper/ics-generator.ts @@ -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"); } } } diff --git a/scraper/scraper.ts b/scraper/scraper.ts index 4be81b929..3b727d5ba 100644 --- a/scraper/scraper.ts +++ b/scraper/scraper.ts @@ -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 {