Skip to content

Conversation

@sertonix
Copy link

Since UTF-16 works with 16-bit values it has a byte order and that byte order is not well defined. There is a convention to use U+FEFF as first character which allows determining the endianess but it's commonly not present and doesn't seem to fit into the current code. The most common thing is to assume little-endian which is what I did here and is already implied by the test suite. If supporting both big- and little-endian UTF-16 is wanted one could create _UTF16LE and _UTF16BE variations of the functions.

@necouchman
Copy link
Contributor

@sertonix Thank you very, much, we appreciate the contribution. Before we can accept and merge these changes you'll need to follow our standard contribution guidelines, which includes:

  • Requesting a Jira account and creating a Jira ticket for this change.
  • Prefixing the Pull Request and Commit Messages with the Jira issue (GUACAMOLE-XXXX:).

See the following links for more info:

Since UTF-16 works with 16-bit values it has a byte order and that byte
order is not well defined. There is a convention to use U+FEFF as first
character which allows determining the endianess but it's commonly not
present and doesn't seem to fit into the current code. The most common
thing is to assume little-endian which is what I did here and is already
implied by the test suite. If supporting both big- and little-endian
UTF-16 is wanted one could create _UTF16LE and _UTF16BE variations of
the functions.
@sertonix sertonix changed the title Fix GUAC_*_UTF16 on big-endian machine GUACAMOLE-2153: Fix GUAC_*_UTF16 on big-endian machine Oct 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants