diff --git a/ui/control/telnet.js b/ui/control/telnet.js index 092e7d7..30df246 100644 --- a/ui/control/telnet.js +++ b/ui/control/telnet.js @@ -453,7 +453,13 @@ class Control { } let currentLen = 0; - const enc = new iconv.encode(data, this.charset); + let enc = null; + + if (this.charset !== "utf-8") { + enc = new iconv.encode(data, this.charset); + } else { + enc = new TextEncoder().encode(data); + } while (currentLen < enc.length) { const iacPos = this.searchNextIAC(currentLen, enc);