Fix HtmlEncode handling of surrogate pairs (dotnet/corefx#41576)
authorStephen Toub <stoub@microsoft.com>
Sun, 6 Oct 2019 02:33:18 +0000 (22:33 -0400)
committerGitHub <noreply@github.com>
Sun, 6 Oct 2019 02:33:18 +0000 (22:33 -0400)
commit25b777b2405db5b4143179bf852120c59bf1a13f
tree10433b0640baab06a2c61976b384f4462b5b9722
parent95022c31b56e56455cca4db901dd3d535e66fe19
Fix HtmlEncode handling of surrogate pairs (dotnet/corefx#41576)

Due to a regression that came as part of changing the code from using pointers to using spans, when the surrogate pair isn't at the beginning of the the input, it's incorrectly encoded.

Commit migrated from https://github.com/dotnet/corefx/commit/6de42378223c6cb138d28f812c440092718c7a19
src/libraries/System.Runtime.Extensions/src/System/Net/WebUtility.cs
src/libraries/System.Runtime.Extensions/tests/System/Net/WebUtility.cs