From f00cb336198c865451de30d55860e477323ba7d7 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Mon, 5 Aug 2013 22:23:30 -0700 Subject: [PATCH] Implement UTF-8 to UTF-16 conversion function. --- src/protocols/rdp/unicode.c | 19 +++++++++++++++++++ src/protocols/rdp/unicode.h | 5 +++++ 2 files changed, 24 insertions(+) diff --git a/src/protocols/rdp/unicode.c b/src/protocols/rdp/unicode.c index 2d628ee6..0e7b6015 100644 --- a/src/protocols/rdp/unicode.c +++ b/src/protocols/rdp/unicode.c @@ -60,3 +60,22 @@ void guac_rdp_utf16_to_utf8(const unsigned char* utf16, char* utf8, int length) } +void guac_rdp_utf8_to_utf16(const unsigned char* utf8, char* utf16, int length) { + + int i; + uint16_t* out_codepoint = (uint16_t*) utf16; + + /* For each UTF-8 character */ + for (i=0; i