Mask unsupported clipboard characters

Add a more explicit '?' for characters that the clipboard cannot handle,
instead of getting random junk.
This commit is contained in:
Pierre Ossman
2022-10-27 16:03:22 +02:00
parent 0410cbc190
commit 6b555f1f74
2 changed files with 16 additions and 2 deletions
+8
View File
@@ -433,6 +433,14 @@ describe('Remote Frame Buffer Protocol Client', function () {
new Uint8Array([97, 98, 99]));
});
it('should mask unsupported characters', function () {
client.clipboardPasteFrom('abc€');
expect(RFB.messages.clientCutText).to.have.been.calledOnce;
expect(RFB.messages.clientCutText).to.have.been.calledWith(client._sock,
new Uint8Array([97, 98, 99, 63]));
});
it('should send an notify if extended clipboard is supported by server', function () {
// Send our capabilities
let data = [3, 0, 0, 0];