add UTF8 support for clipboard

This commit is contained in:
pom 2022-09-03 16:35:54 +08:00
parent 2f1e11b54a
commit 92a20cfb84
1 changed files with 1 additions and 1 deletions

View File

@ -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);
}