Skip to content

[release/11.0] Restoring autoConvert behavior in Clipboard APIs - #11895

Open
github-actions[bot] wants to merge 1 commit into
release/11.0from
backport/pr-11837-to-release/11.0
Open

[release/11.0] Restoring autoConvert behavior in Clipboard APIs#11895
github-actions[bot] wants to merge 1 commit into
release/11.0from
backport/pr-11837-to-release/11.0

Conversation

@github-actions

@github-actions github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

Backport of #11837 to release/11.0

Fixes mojibake character issue in dotnet/winforms#14322

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 September 3, 2026 18:28
@github-actions
github-actions Bot requested a review from a team as a code owner September 3, 2026 18:28
@dotnet-policy-service dotnet-policy-service Bot added the PR metadata: Label to tag PRs, to facilitate with triage label Sep 3, 2026
@Shyam-Gupta Shyam-Gupta self-assigned this Sep 3, 2026
@Shyam-Gupta

Copy link
Copy Markdown
Member

@pranav-gupta-msft, @dipeshmsft, @subhajitm This change is already merged in main and release/10.0 branch. Requesting your approval to merge it in release/11.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR metadata: Label to tag PRs, to facilitate with triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant