According to this table, I need to Encode a string in C# the following way: Only encode the characters that have an HTML Name, with their HTML Name from the table in the link (and the symbols that do NOT have HTML Name should stay the same and not replaced with their HTML Number).
for example: I want the string & '
to be encoded to & '
, but the results I am getting are giving & '
, it is converting a symbol that also does not have a HTML Name.
HttpUtility.HtmlEncode();
is encoding to both HTML Name and HTML Number..
UPDATE:
trying to use Microsoft.Security.Application.Encoder.HtmlEncode
(link) is giving also the same encoding results.
Any suggestions for other solution?