Github user mike-jumper commented on a diff in the pull request:

    https://github.com/apache/guacamole-server/pull/154#discussion_r170828849
  
    --- Diff: src/protocols/rdp/guac_rdpdr/rdpdr_messages.c ---
    @@ -273,3 +273,15 @@ void 
guac_rdpdr_process_prn_using_xps(guac_rdpdrPlugin* rdpdr, wStream* input_st
         guac_client_log(rdpdr->client, GUAC_LOG_INFO, "Printer unexpectedly 
switched to XPS mode");
     }
     
    +int guac_rdpdr_encode_utf16(const char* input_string, char* output_string) 
{
    --- End diff --
    
    This function as written would not actually convert things properly, as the 
input string is UTF-8. Characters in UTF-8 vary in byte length, and simply 
adding a null byte for each input byte will only work for a very small subset 
of UTF-8. Thankfully, we've actually done this already within 
`guac_rdp_utf8_to_utf16()` (defined within `unicode.h`):
    
    
https://github.com/apache/guacamole-server/blob/bc5b01d4d8ab0c3c89a08007316d33012261f6b3/src/protocols/rdp/unicode.h#L41-L57


---

Reply via email to