Skip to content

[release/10.0] Restoring autoConvert behavior in Clipboard APIs - #11867

Merged
Shyam-Gupta merged 1 commit into
release/10.0from
backport/pr-11837-to-release/10.0
Aug 27, 2026
Merged

Shyam-Gupta merged 1 commit into
release/10.0from
backport/pr-11837-to-release/10.0

Conversation

@github-actions

@github-actions github-actions Bot commented Aug 25, 2026 •

Copy link
Copy Markdown

Backport of #11837 to release/10.0
Fixes mojibake character issue in dotnet/winforms#14983

Description

Till .NET 9.0, autoConvert was set to true only for FileDrop and Bitmap scenarios. However, since .NET 10, it is being set to true for GetAudioStream, GetFileDropList, GetImage, and GetText APIs inside the private method GetTypedDataIfAvailable. This causes issues with GetText API with mojibake characters as described in bug dotnet/winforms#14322

Customer Impact

There is no way for the app to know whether the clipboard contents were corrupted or if there is any problem with the API as it didn't get the desired data.

Regression

Yes - from .NET 9.0

Testing

Created a WPF app to write unicode data on the clipboard and another app to read it. Before the changes, the reader app returned several hits for mojibake characters. After fix, there were none.

Risk

This should be a very low risk change as this behavior was working fine in 9.0 and previous versions.

Microsoft Reviewers: Open in CodeFlow

* Restoring autoConvert to .NET 8.0 in Clipboard APIs

* Added unit test

* Also setting autoConvert to false in one of the TryGetData overload.

* Formatting
@github-actions
github-actions Bot requested a review from a team August 25, 2026 20:38
@dotnet-policy-service dotnet-policy-service Bot added the PR metadata: Label to tag PRs, to facilitate with triage label Aug 25, 2026
@Shyam-Gupta Shyam-Gupta self-assigned this Aug 25, 2026
@Shyam-Gupta Shyam-Gupta added Servicing-consider area-clipboard Issues related to DataObject and shared clipboard labels Aug 25, 2026
@Shyam-Gupta

Copy link
Copy Markdown
Member

@harshit7962, @pranav-gupta-msft, @subhajitm - requesting one more approval.

@Shyam-Gupta
Shyam-Gupta merged commit 0987b40 into release/10.0 Aug 27, 2026
8 checks passed
@Shyam-Gupta
Shyam-Gupta deleted the backport/pr-11837-to-release/10.0 branch August 27, 2026 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-clipboard Issues related to DataObject and shared clipboard PR metadata: Label to tag PRs, to facilitate with triage Servicing-approved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants