From 7ad72f6ff8700637ac35981e5da6d78bbabca8f9 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 13 Sep 2025 22:27:25 -0500 Subject: [PATCH] Fix encoding of index.html --- iframe-fetch-client/_iframe-client.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iframe-fetch-client/_iframe-client.js b/iframe-fetch-client/_iframe-client.js index 6ddb07f9..e7281caa 100644 --- a/iframe-fetch-client/_iframe-client.js +++ b/iframe-fetch-client/_iframe-client.js @@ -187,10 +187,11 @@ class FetchClient { throw new Error(`Unexpected Content-Type: ${response.headers["Content-Type"]}`); } - const decoded = atob(response.body); + const bytes = new Uint8Array(atob(response.body).split('').map(c => c.charCodeAt(0))); + const text = new TextDecoder().decode(bytes); // Replace current document with the site index content - this.replaceDocument(decoded); + this.replaceDocument(text); } catch (error) { this.showError("Failed to load site index", error); }