Skip to content

Compat: Revert behavior of DecoderNLS / EncoderNLS.Convert to match Full Framework #594

@GrabYourPitchforks

Description

@GrabYourPitchforks

Background

Marked as blocking-partner since a first-party partner is having trouble with deployment due to this.

In .NET Core 3.x, we made a change to how Encoder.Convert and Decoder.Convert work in order to fix how the completed parameter's values are set on output and to bring the methods in line with the Remarks section of the documentation. See https://github.com/dotnet/coreclr/issues/23020 and https://github.com/dotnet/coreclr/issues/27191 for the original bugs.

Unfortunately the sample code in the Examples section of the documentation relies on the old non-compliant behavior of these methods, and it's leading to regressions in applications which have used that sample code. See https://github.com/dotnet/corefx/issues/42423 for one example, where the application enters an infinite loop on some inputs.

Proposed behavioral change

The proposal is to restore the completed output parameter logic that was present in Full Framework and .NET Core 1.x / 2.x.

We've already identified some call sites that might regress as a result of backing out these changes, and work items are open for those issues. See dotnet/aspnetcore#17747 for one example.

Metadata

Metadata

Labels

area-System.Text.EncodingblockingMarks issues that we want to fast track in order to unblock other important worktenet-compatibilityIncompatibility with previous versions or .NET FrameworkuntriagedNew issue has not been triaged by the area owner

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions