Forum Discussion
Bug in RDS Web Client - Copied text in RD session improperly encoded
As the title describes, there appears to be a bug in the HTML5 web client for Remote Desktop Services. This bug is present in both 2.1.85.0 and 2.1.87.0, and possibly earlier. When text is copied to the clipboard within a remote session (tested via a published RemoteApp), the text will occasionally be stored into the clipboard of the local machine encoded in UTF-8 instead of UTF-16 as it is supposed to be. When pasted into an application on the client machine, the UTF-8 encoded text (stored as CF_UNICODETEXT) is interpreted as UTF-16 (as that's how it's supposed to be encoded in memory as that's what Windows uses internally), resulting in meaningless output/mojibake.
As an example, the text "Given" is copied from a Remote Desktop session (via the web client). The endpoint has these formats on the clipboard:
| Copied text | CF_UNICODETEXT hex (padded) | CF_TEXT hex | Decoded text - UTF-8 | Decoded text - UTF-16LE |
| Given | 47 69 76 65 6E 00 00 00 | 3F 3F 6E 00 | Given | 楇敶n |
The behavior is seemingly random. Most of the time, text is copied without issue. Once out of every 5-10 times, however, the UTF-8 encoded text is incorrectly written to the clipboard. Some additional information about this behavior:
- It only happens when using the RDS web client. The native RDP client does not exhibit this behavior.
- This has only been observed on Windows clients. It hasn't been observed on other client platforms, but testing has been minimal.
- The client browser does not appear to factor into the bug. It has been observed in Edge, Chrome, and Firefox.
- The issue is unrelated to the text copied. The same text, from the same application, can produce both outcomes when copied.
- The application being pasted into seems to be irrelevant.
Has anyone else seen this behavior?
2 Replies
Yes, seems a known bug, beofre the patch, may consideirng to use the native RDP client or the older web client URL for critical workflows requiring reliable clipboard operations. Track updates to the RDS Web Client release notes in the meantime.
Your byte dump is consistent with text bytes being exposed under the wrong clipboard format: CF_UNICODETEXT denotes Unicode text, and Windows Unicode functions use UTF-16. However, “Given” alone cannot establish UTF-8 specifically, because its characters have identical ASCII and UTF-8 bytes. Including an accented character and a supplementary Unicode character would distinguish those possibilities.
Since you reproduced this across three browsers and the native client behaves correctly, repeating browser reinstalls would add little evidence. Capture a good and bad copy of the same synthetic string, including all advertised clipboard formats, timestamps and client/server builds.
The RDS web client has support capture: open the ellipsis menu, choose About, start recording under Capture support information, reproduce the corruption, then stop recording to download RD Console Logs.txt. Submit that with your reproduction through Microsoft's support channel. I cannot confirm a published fix for these versions; retain the working native-client workaround meanwhile.