Skip to content

Commit

Permalink
Fix unicode problems
Browse files Browse the repository at this point in the history
  • Loading branch information
rmens committed Oct 26, 2024
1 parent 1dec4c4 commit 12a82eb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion assets/js/ttveditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@
}

function base64EncodeUnicode(str) {
return btoa(unescape(encodeURIComponent(str)));
// Convert string to an array of UTF-8 byte code points
let utf8Bytes = new TextEncoder().encode(str);
// Convert byte array to Base64 string
return btoa(String.fromCharCode(...utf8Bytes));
}

function generateBase64() {
Expand Down

0 comments on commit 12a82eb

Please sign in to comment.