1

Consider this code:

// Dictionary created.

Dictionary<string, string> objDic = new Dictionary<string, string>();
string test = "<>";
objDic.Add("html", test);

var Json = new JavaScriptSerializer();

string response = Json.Serialize(return_obj);

Output response:

[{"html":"\u003c\u003e"}]

Expected response:

[{"html":"<>"}]

How do I get the expected response?

1 Answer 1

3

Then you can use Json.NET:

var str = JsonConvert.SerializeObject(new {html="<>"}) //returns {"html":"<>"}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.