Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions guacamole-common-js/src/main/webapp/modules/Keyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -892,6 +892,11 @@ Guacamole.Keyboard = function Keyboard(element) {

// Determine keysym of current character
var codepoint = str.codePointAt ? str.codePointAt(i) : str.charCodeAt(i);

// For surrogate pairs, skip the second 16 bits.
if (str.charCodeAt(i) != codepoint) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comparison should use !== (same elsewhere).

i++;
}
var keysym = keysym_from_charcode(codepoint);

// Press and release key for current character
Expand Down
9 changes: 7 additions & 2 deletions guacamole-common-js/src/main/webapp/modules/StringWriter.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,12 @@ Guacamole.StringWriter = function(stream) {

// Fill buffer with UTF-8
for (var i=0; i<text.length; i++) {
var codepoint = text.charCodeAt(i);
var codepoint = text.codePointAt ? text.codePointAt(i) : text.charCodeAt(i);;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beware you accidentally added an extra semicolon here (null statement).


// For surrogate pairs, skip the second 16 bits.
if (text.charCodeAt(i) != codepoint) {
i++;
}
__append_utf8(codepoint);
}

Expand Down Expand Up @@ -202,4 +207,4 @@ Guacamole.StringWriter = function(stream) {
*/
this.onack = null;

};
};
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,14 @@ angular.module('textInput').directive('guacTextInput', [function guacTextInput()

// Send each codepoint within the string
for (var i=0; i<content.length; i++) {
var codepoint = content.charCodeAt(i);
var codepoint = content.codePointAt ? content.codePointAt(i) : content.charCodeAt(i);

// For surrogate pairs, skip the second 16 bits.
if (content.charCodeAt(i) != codepoint) {
i++;
}
if (codepoint !== TEXT_INPUT_PADDING_CODEPOINT) {
sentText += String.fromCharCode(codepoint);
sentText += String.fromCodePoint ? String.fromCodePoint(codepoint) : String.fromCharCode(codepoint);
sendCodepoint(codepoint);
}
}
Expand Down