html - C# HtmlEncode name only -
According to the table, I have to encode a string in C # in the following way: Encoded only the characters named HTML, with their HTML name in the link from the table (and the symbols that HTML name Do not keep the same, and should not be replaced with their HTML number ).
For example: I get the string & amp; '
should be encoded ; '
, but the results I'm getting are giving it & amp; Amp; & Amp; # 39;
, it is converting a symbol that does not have an HTML name.
HttpUtility.HtmlEncode ();
is encoding for both HTML name and HTML number.
Update: Using Microsoft.Security.Application Trying to do Encoder.HtmlEncode
() is also giving the same encoding results.
Any suggestions for other solutions?