change demo to utf8 input

This commit is contained in:
Jörg Breitbart
2019-01-20 23:06:51 +01:00
parent 3a2076805c
commit e6e5ecc0f2
3 changed files with 13 additions and 6 deletions
+5
View File
@@ -42,6 +42,11 @@ export function attach(term: Terminal, socket: WebSocket, bidirectional: boolean
addonTerminal.__getMessage = function(ev: MessageEvent): void {
let str: string;
if (ev.data instanceof ArrayBuffer) {
addonTerminal.writeUtf8(new Uint8Array(ev.data));
return;
}
if (typeof ev.data === 'object') {
if (!myTextDecoder) {
myTextDecoder = new TextDecoder();