Skip to content

Regression: Clipboard.GetText() returns corrupted text (mojibake) randomly in .NET 10 #14983

Closed

Description

@Shyam-Gupta

Description

After migrating an application to .NET 10, Clipboard.GetText() sometimes returns corrupted text when reading Unicode (e.g., Japanese) content from the Windows clipboard. This behavior did not occur prior to .NET 10.

Example of corrupted output:

Expected:
「うわ、ほんとだ……あれ、どれくらいの高さなんだろ」
Actual:
????????・????????????????

The issue appears intermittently and is difficult to reproduce deterministically, but becomes noticeable under frequent clipboard updates. Note that using Clipboard.ContainsText(TextDataFormat.UnicodeText) and Clipboard.GetText(TextDataFormat.UnicodeText) has the exact same problem.

Reproduction Steps

  1. Create a WPF/WinForms application targeting .NET 10.
  2. Monitor clipboard changes using WM_CLIPBOARDUPDATE.
  3. On clipboard updates, call Clipboard.GetText() to retrieve text contents.
  4. Frequently copy Unicode text to Clipboard

Minimal example:

if (Clipboard.ContainsText()) // You can also use Clipboard.ContainsText(TextDataFormat.UnicodeText)
{
// Occasionally returns mojibake
string text = Clipboard.GetText(); // Clipboard.GetText(TextDataFormat.UnicodeText)
}

Intermittently, the returned string contains corrupted characters instead of the original Unicode text (this is rarer).

Expected behavior

Expected behavior

Clipboard.GetText() should consistently return the correct Unicode text as placed on the clipboard. It should never silently return corrupted text.

Actual behavior

Clipboard.GetText() intermittently returns string containing mojibake (e.g., ?, ・) characters.

No exception is thrown in these cases.

Regression?

Yes.

Yes. This code path worked reliably in previous .NET versions. I never had a problem with .NET 5, .NET 6, .NET 7, .NET 8, .NET 9.

Activity

  1. added this to the .NET 11 milestone on Aug 25, 2026
  2. self-assigned this
    on Aug 25, 2026
  3. added
    area-Clipboard
    on Aug 25, 2026
  4. added theissue type on Aug 25, 2026
  5. modified the milestones: .NET 11, .NET 10.0 on Aug 27, 2026
  6. locked and limited conversation to collaborators on Sep 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area-Clipboard

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions