You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Regression: Clipboard.GetText() returns corrupted text (mojibake) randomly in .NET 10 #14983
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.
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
Create a WPF/WinForms application targeting .NET 10.
Monitor clipboard changes using WM_CLIPBOARDUPDATE.
On clipboard updates, call Clipboard.GetText() to retrieve text contents.
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.
Activity