Use Utf8.IsValid in System.Text.Json (#88165)
authorStephen Toub <stoub@microsoft.com>
Thu, 29 Jun 2023 13:52:36 +0000 (09:52 -0400)
committerGitHub <noreply@github.com>
Thu, 29 Jun 2023 13:52:36 +0000 (09:52 -0400)
commit7ab70f9041153fd07768f6795ee788cd3d3bdcc0
treea10229438e3fd1ee9858a619431720079f1419ec
parent41a624dc00544476e2da7e9d36577054c75f62fb
Use Utf8.IsValid in System.Text.Json (#88165)

* Use Utf8.IsValid in System.Text.Json

* Fix TestingGetStringInvalidUTF8 test

It's expecting there to always be a DecoderFallbackException as the inner exception.
src/libraries/System.Text.Json/src/System/Text/Json/Reader/JsonReaderHelper.Unescaping.cs
src/libraries/System.Text.Json/src/System/Text/Json/ThrowHelper.cs
src/libraries/System.Text.Json/src/System/Text/Json/Writer/JsonWriterHelper.cs
src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.TryGet.cs