shadok-ai 0.2.8 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/public/index.html +9 -1
package/package.json
CHANGED
package/public/index.html
CHANGED
|
@@ -3644,6 +3644,14 @@
|
|
|
3644
3644
|
for (let i = 0; i < bin.length; i++) a[i] = bin.charCodeAt(i);
|
|
3645
3645
|
return a;
|
|
3646
3646
|
}
|
|
3647
|
+
// Keystroke → base64, UTF-8 first. btoa() alone treats the string as Latin1,
|
|
3648
|
+
// so "é" (U+00E9) went out as the single byte 0xE9 instead of its UTF-8 pair
|
|
3649
|
+
// 0xC3 0xA9 → mojibake in the pane; anything above U+00FF (emoji…) threw.
|
|
3650
|
+
function strToB64Utf8(s) {
|
|
3651
|
+
let bin = "";
|
|
3652
|
+
for (const b of new TextEncoder().encode(s)) bin += String.fromCharCode(b);
|
|
3653
|
+
return btoa(bin);
|
|
3654
|
+
}
|
|
3647
3655
|
function updateTermBtn() {
|
|
3648
3656
|
const on = !!(active && active.termOn);
|
|
3649
3657
|
const b = $("chanTerm");
|
|
@@ -3669,7 +3677,7 @@
|
|
|
3669
3677
|
term.open($("xtermHost"));
|
|
3670
3678
|
term.onData((d) => {
|
|
3671
3679
|
if (term && termSession && termSession.ws)
|
|
3672
|
-
termSession.ws.send(JSON.stringify({ type: "term-input", data:
|
|
3680
|
+
termSession.ws.send(JSON.stringify({ type: "term-input", data: strToB64Utf8(d) }));
|
|
3673
3681
|
});
|
|
3674
3682
|
}
|
|
3675
3683
|
if (termSession !== active) {
|