I need to write the equivalent to this php code
json_encode(utf8_encode())
in objective-c
I've implemented the equivalent to utf8_encode with
[NSString stringWithCString:[testString cStringUsingEncoding:NSUTF8StringEncoding] encoding:NSASCIIStringEncoding]
So now, I need to implement the equivalent to json_encode php function.
input : "http://www.mydomain.com/s?c=Théâtre,Cinéma"
expected output : "http://www.mydomain.com/s?c=Th\u00c3\u00a9\u00c3\u00a2tre,Cin\u00c3\u00a9ma"
Does anyone have an efficient way to do that?