NSData to NSString with JSON response
问题 NSData* jsonData is the http response contains JSON data. NSString* jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; NSLog(@"jsonString: %@", jsonString); I got the result: { "result": "\u8aaa" } What is the proper way to encoding the data to the correct string, not unicode string like "\uxxxx"? 回答1: If you convert the JSON data { "result" : "\u8aaa" } to a NSDictionary (e.g. using NSJSONSerialization ) and print the dictionary NSError *error; NSDictionary