我收到一些帶有奇怪UTF-8字符串的JSON。例如:正確地在iOS上處理JSON中的UTF-8
{
"title": "It\U2019s The End";
}
什麼來處理這些數據,以便它可以以可讀的方式呈現的最佳方式?我想將\ U2019轉換爲它應該代表的引號。
編輯: 假設我已經解析字符串成的NSString * jsonResult
編輯2:
AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) {
NSString* jsonResult = [JSON valueForKeyPath:@"title"];
} failure:nil];
你如何解析你的json? –
我已更新我的問題以顯示JSON來自哪裏。 – hodgesmr
http://stackoverflow.com/questions/10838372/objective-c-nsstring-not-being-entirely-decoded-from-utf-8 –