From 1258fa3a813ee59c2d69e7b8a8479e7481ada4a7 Mon Sep 17 00:00:00 2001 From: Dushyantcoder07 Date: Wed, 27 May 2026 15:42:05 +0530 Subject: [PATCH] fix(page): replace unsafe base64 helpers with UTF-8-safe encoding --- app/page.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/page.tsx b/app/page.tsx index d3c5c18..f251cca 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,10 +1,12 @@ "use client" const safeBase64Encode = (str: string) => - btoa(unescape(encodeURIComponent(str))); + btoa( + Array.from(new TextEncoder().encode(str), (byte) => String.fromCodePoint(byte)).join("") + ) const safeBase64Decode = (str: string) => - decodeURIComponent(escape(atob(str))); + new TextDecoder().decode(Uint8Array.from(atob(str), (char) => char.codePointAt(0) ?? 0)) import type React from "react" import { useState, useEffect, useRef } from "react"