tags:

views:

4624

answers:

3

Are there any classes/functions available to be used for easy JSON escaping? Id rather not have to write my own.

A: 

There's a Json library at Codeplex

Jim Schubert
and examples: http://james.newtonking.com/projects/json/help/
Jim Schubert
+2  A: 

You may want to check out An Introduction to JSON in .Net on MSDN, and the JsonConvert class from JayRock JSON.

As a side note, we use Jayrock for all our Json purposes for our products.

womp
+1  A: 

I would also recommend using the JSON.NET library mentioned, but if you have to escape unicode characters (e.g. \uXXXX format) in the resulting JSON string, you may have to do it yourself. Take a look at Converting Unicode strings to escaped ascii string for an example.

Kevin Hakanson