AngleSharp by AngleSharp

<PackageReference Include="AngleSharp" Version="1.0.1" />

 IHtmlEncoder

public interface IHtmlEncoder
Represents the HTML encoder.
string Encode(string value, Encoding encoding)

Replaces characters in names and values that cannot be expressed by using the given encoding with &#...; base-10 unicode point.