diff --git a/src/System.Private.CoreLib/shared/System/Text/DecoderNLS.cs b/src/System.Private.CoreLib/shared/System/Text/DecoderNLS.cs index 8cb3fffe1b30..a8153ffd906e 100644 --- a/src/System.Private.CoreLib/shared/System/Text/DecoderNLS.cs +++ b/src/System.Private.CoreLib/shared/System/Text/DecoderNLS.cs @@ -207,9 +207,13 @@ public unsafe override void Convert(byte* bytes, int byteCount, charsUsed = _encoding.GetChars(bytes, byteCount, chars, charCount, this); bytesUsed = _bytesUsed; - // Its completed if they've used what they wanted AND if they didn't want flush or if we are flushed - completed = (bytesUsed == byteCount) && (!flush || !this.HasState) && - (_fallbackBuffer == null || _fallbackBuffer.Remaining == 0); + // Per MSDN, "The completed output parameter indicates whether all the data in the input + // buffer was converted and stored in the output buffer." That means we've successfully + // consumed all the input _and_ there's no pending state or fallback data remaining to be output. + + completed = (bytesUsed == byteCount) + && !this.HasState + && (_fallbackBuffer is null || _fallbackBuffer.Remaining == 0); // Our data thingy are now full, we can return } diff --git a/tests/CoreFX/CoreFX.issues.rsp b/tests/CoreFX/CoreFX.issues.rsp index e6f33eba0798..fb0cfcf242d9 100644 --- a/tests/CoreFX/CoreFX.issues.rsp +++ b/tests/CoreFX/CoreFX.issues.rsp @@ -70,6 +70,10 @@ # https://github.com/dotnet/coreclr/issues/22414 -nomethod System.Numerics.Tests.ToStringTest.RunRegionSpecificStandardFormatToStringTests +# Failure in System.Text.Encoding.Tests due to bug fix in DecoderNLS.Convert +# https://github.com/dotnet/coreclr/issues/27191 +-nomethod System.Text.Tests.DecoderConvert2.PosTest6 + # Timeout in System.Text.RegularExpressions.Tests.RegexMatchTests.Match_ExcessPrefix # https://github.com/dotnet/coreclr/issues/18912 -nomethod System.Text.RegularExpressions.Tests.RegexMatchTests.Match_ExcessPrefix