When porting WebUtility missing members:
public static class WebUtility {
public static void HtmlDecode(string value, TextWriter output);
public static void HtmlEncode(string value, TextWriter output);
}
We found that we already had a private method on .NET Core that would do exactly the same as this two members but instead of having a TextWriter as the output they have a StringBuilder. This members where ported on PR dotnet/corefx#13875 with a simple solution of just calling the existing private member and writing the result to the TextWriter output Here is the source code.
On PR dotnet/corefx#13875 we had a large discussion with different solutions. With a conclusion that the best one is @jkotas's solution.
cc @danmosemsft @AlexGhiondea
When porting
WebUtilitymissing members:We found that we already had a private method on .NET Core that would do exactly the same as this two members but instead of having a
TextWriteras the output they have aStringBuilder. This members where ported on PR dotnet/corefx#13875 with a simple solution of just calling the existing private member and writing the result to theTextWriter outputHere is the source code.On PR dotnet/corefx#13875 we had a large discussion with different solutions. With a conclusion that the best one is @jkotas's solution.
cc @danmosemsft @AlexGhiondea