Open
Description
(Placeholder while I spend some time formalizing the issue and coming up with new sample code.)
The sample code at https://docs.microsoft.com/en-us/dotnet/api/system.text.decoder.convert and https://docs.microsoft.com/en-us/dotnet/api/system.text.encoder.convert (all Framework versions) demonstrates using the Convert
methods incorrectly, as they make incorrect assumptions about the behavior of the completed out parameter. We should update the sample code to show correct API usage.
This is particularly problematic in .NET Core 3.x, where bug fixes in the Encoder.Convert
and Decoder.Convert
methods may cause the sample code present in the docs to go into an infinite loop. See https://github.com/dotnet/corefx/issues/42423 for one such example.