-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Encoding regression #111320
Fix Encoding regression #111320
Conversation
The fix of this issue needs to be backported to the 9.0 servicing release. |
src/libraries/System.Text.Encoding.CodePages/src/System/Text/EncodingCharBuffer.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Text.Encoding.CodePages/tests/EncodingCodePages.cs
Outdated
Show resolved
Hide resolved
Seems like
|
I'll take a look |
/backport to release/9.0 |
Started backporting to release/9.0: https://github.com/dotnet/runtime/actions/runs/12754927051 |
/ba-g the failing build is timeout which happened in other PRs. |
#110521
The change here is fixing a regression from the change #97950.
The regression occurs in the multi-byte encoding when handling a surrogate pair. It incorrectly throws an exception when the character buffer is null, which is not the expected behavior. The code should be resilient to a null buffer, avoiding exceptions and instead returning only the count of the decoded characters.
The change is not reverting #97950 as the rest of the changes are beneficial.