From 203cb8a7f05f3f5535ada42a7b519e0b4e29c12a Mon Sep 17 00:00:00 2001 From: Amazingca Date: Tue, 12 May 2026 14:16:59 -0600 Subject: [PATCH] Encode URI data to allow for unicode characters --- app/settings.js | 5 +---- app/todos.js | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/app/settings.js b/app/settings.js index bd413fd..81707f4 100644 --- a/app/settings.js +++ b/app/settings.js @@ -34,7 +34,7 @@ document.getElementById("exportData").addEventListener("click", async (event) => theme: theme }; - const exportURL = window.location.href.replace("settings", "").replace(".html", "") + "index.html#" + btoa(JSON.stringify(dataExport)); + const exportURL = window.location.href.replace("settings", "").replace(".html", "") + "index.html#" + btoa(encodeURIComponent(JSON.stringify(dataExport))); if (!window.navigator.userAgent.includes("Firefox") && !/(Linux|Windows|Mac)/g.test(window.navigator.platform)) { @@ -51,13 +51,10 @@ document.getElementById("exportData").addEventListener("click", async (event) => }, 2000); } catch (e) { - window.alert(e); console.error(e); } } else { - window.alert("Window not detected"); - navigator.clipboard.writeText(exportURL); exportDataText.innerHTML = "link copied!"; diff --git a/app/todos.js b/app/todos.js index c90b673..fb49421 100644 --- a/app/todos.js +++ b/app/todos.js @@ -35,7 +35,7 @@ if (window.location.hash.length > 0) { try { - ({todos, archived, theme} = JSON.parse(atob(window.location.hash.substring(1)))); // using parenthesis around this is required because we're doing object literal destructuring without a declaration + ({todos, archived, theme} = JSON.parse(decodeURIComponent(atob(window.location.hash.substring(1))))); // using parenthesis around this is required because we're doing object literal destructuring without a declaration backupData(); } catch (e) { -- 2.54.0