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); }