I am in the process of converting some of our web \"services\" to MVC3 from WCF Rest.
Our old web services returned JSON from POCO\'s just fine using:
[WebGet(
That shouldn't be any problem, as both representations are equivalent:
var a = {"CategoryId":8,"SomeId":6,"Name":"Richie\u0027s House"};
alert(a.Name);
alerts Richie's House.
Just do:
yourObject.Name = yourObject.Name.replace("'", "\\u027");
So, if you try to alert in javascript or show in a browser, it will appears like:
Richie's House
U+0027 is Unicode for apostrophe (')
So, special characters are returned in Unicode but will show up properly when rendered on the page.