How to encode the '
to \u0027
with JSON.NET?
So that the json string would look something like this:
{"Id":8,"CompanyName":"Jane\u0027s bakery"}
Sample Call
Newtonsoft.Json.JsonConvert.SerializeObject(your_object,
Newtonsoft.Json.Formatting.None,
new Newtonsoft.Json.JsonSerializerSettings
{ StringEscapeHandling = Newtonsoft.Json.StringEscapeHandling.EscapeHtml })
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With