Sto ricevendo alcuni JSON con stringhe UTF-8 strane. Ad esempio:Gestire correttamente UTF-8 in JSON su iOS
{
"title": "It\U2019s The End";
}
Qual è il modo migliore per gestire questi dati in modo che possa essere presentato in modo leggibile? Mi piacerebbe convertire \ U2019 nella citazione che dovrebbe rappresentare.
Edit: Assumere Ho analizzato la stringa in un NSString * jsonResult
Edit 2: Sto ricevendo il JSON attraverso AFNetworking:
AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) {
NSString* jsonResult = [JSON valueForKeyPath:@"title"];
} failure:nil];
come si analizza il tuo json? –
Ho aggiornato la mia domanda per mostrare da dove proviene il JSON. – hodgesmr
http://stackoverflow.com/questions/10838372/objective-c-nsstring-not-being-entely-decoded-from-utf-8 –