Skip to content
Open
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: 3 additions & 2 deletions src/common/iconv.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#include <guacamole/unicode.h>
#include <stdint.h>
#include <endian.h>

/**
* Lookup table for Unicode code points, indexed by CP-1252 codepoint.
Expand Down Expand Up @@ -109,7 +110,7 @@ int GUAC_READ_UTF16(const char** input, int remaining) {
return 0;

/* Read two bytes as integer */
value = *((uint16_t*) *input);
value = le16toh(*((uint16_t*) *input));
*input += 2;

return value;
Expand Down Expand Up @@ -213,7 +214,7 @@ void GUAC_WRITE_UTF16(char** output, int remaining, int value) {
return;

/* Write two bytes as integer */
*((uint16_t*) *output) = value;
*((uint16_t*) *output) = htole16(value);
*output += 2;

}
Expand Down