I have a C# code which handles Unicode characters. The below code also encodes XSS code.
String s = "<<SCRIPT>alert("Hack");//<</SCRIPT>";
var resultText = Microsoft.Security.Application.AntiXss.HtmlEncode(s);
string encodedValue = HttpUtility.UrlEncode(resultText, Encoding.UTF8).Replace("+", "")
txtResult.Text = encodedValue;// display in the text box in UI
But the above displays data in a different way.I want to display the text
<<SCRIPT>alert("Hack");//<</SCRIPT>
in the textbox( txtResult)
Can any one help me in achieving this. Basically i am trying to handle XSS and Unicode characters.