From 92a20cfb845ca30e9ab5a518bf289c840d7c6f3f Mon Sep 17 00:00:00 2001 From: pom Date: Sat, 3 Sep 2022 16:35:54 +0800 Subject: [PATCH] add UTF8 support for clipboard --- core/rfb.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/rfb.js b/core/rfb.js index 4b3526f9..ab11961c 100644 --- a/core/rfb.js +++ b/core/rfb.js @@ -490,9 +490,9 @@ export default class RFB extends EventTargetMixin { this._clipboardText = text; RFB.messages.extendedClipboardNotify(this._sock, [extendedClipboardFormatText]); } else { + text = encodeUTF8(text); let data = new Uint8Array(text.length); for (let i = 0; i < text.length; i++) { - // FIXME: text can have values outside of Latin1/Uint8 data[i] = text.charCodeAt(i); }