-
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 regression or document breaking change in BinaryReader #93500
Comments
Tagging subscribers to this area: @dotnet/area-system-io Issue DetailsFollow-up to #80331 (comment). On the following code: var ms = new MemoryStream(new byte[] { 0x01, 0xC2 });
using (var br = new BinaryReader(ms))
{
string s = br.ReadString();
Console.WriteLine(s);
Console.WriteLine(s.Length);
Console.WriteLine(s == "\uFFFD");
}
Thanks @GrabYourPitchforks for pointing the error after merge and share the affected scenario in question.
|
I've missed the notification. @teo-tsirpanis PTAL |
This new behavior seems the correct one, and matches Unicode standards, and a breaking change done in .NET Core 3.0. |
Thanks, @teo-tsirpanis! Closing this issue since the new behavior is correct and intentional, and it was documented. |
@jeffhandley that document is for 3.0, it may be surprising for customers jumping from 8.0 or lower to not find this documented as part of 9.0 breaking changes. |
Added
Tagging @dotnet/compat for awareness of the breaking change. |
Closed as we concluded we just needed to document this and it was captured in dotnet/docs#42564 |
Follow-up to #80331 (comment).
On the following code:
ReadString
returns empty string on .NET 8 or prior. After #80331, it returns "\uFFFD".Thanks @GrabYourPitchforks for pointing the error after merge and share the affected scenario in question.
cc @teo-tsirpanis @adamsitnik
The text was updated successfully, but these errors were encountered: