我正在尝试使用C#HttpUtility.HtmlEncode
在html属性中编码特殊字符。
当我对以下字符串进行编码
var encode1= HttpUtility.HtmlEncode("Student on \" On the Rise \"");
编码会生成正确的输出,如下所示:
Student on " On the Rise "
浏览器再次对&
进行编码,并生成错误的编码,如下所示:
<meta property="og:title" content="Student on &quot; On the Rise &quot;" />
如何告诉浏览器不要再次对&
字符进行编码?