From 94e200bded4ac40309ad884336c5bd5fb51d2ffe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Tue, 10 Mar 2026 00:31:21 +0800 Subject: [PATCH] Use codePointAt/fromCodePoint instead of charCodeAt/fromCharCode (S7758) Co-Authored-By: Claude Opus 4.6 --- src/utils/returnToEncoding.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/returnToEncoding.js b/src/utils/returnToEncoding.js index a5b15e6..9f0fe7f 100644 --- a/src/utils/returnToEncoding.js +++ b/src/utils/returnToEncoding.js @@ -13,7 +13,7 @@ export function encodeReturnTo(returnToPath) { const bytes = new TextEncoder().encode(returnToPath); let binary = ""; bytes.forEach((byte) => { - binary += String.fromCharCode(byte); + binary += String.fromCodePoint(byte); }); return btoa(binary); } @@ -25,6 +25,6 @@ export function encodeReturnTo(returnToPath) { */ export function decodeReturnTo(encodedReturnTo) { const binary = atob(encodedReturnTo); - const bytes = Uint8Array.from(binary, (char) => char.charCodeAt(0)); + const bytes = Uint8Array.from(binary, (char) => char.codePointAt(0)); return new TextDecoder().decode(bytes); }