Iam嘗試在UITableViewCell中顯示JSON列表。 當我解析我的JSON時,我可以看到UTF8字符,當我顯示UILabels時,UTF8字符串顯示錯誤的值。將JSON中的UTF8字符串轉換爲純文本iOS?
這是我的JSON文件結構
[{"name":"C\u0103r\u021bile pe fa\u021b\u0103 (Taxi Gratis)","code":"TX7","details":"tertert","costperkm":"ertrete","minimumcost":"tetret","taxicontact":[{"carrier":"ertertert","number":"ert"}],"taxistation":[{"stationname":"terterter","latitude":"tertert","longitude":"rete","details":"terterterter"}],"logo":"","tag":"tertertertert"}]
我想在我的UILabel顯示此"name":"C\u0103r\u021bile pe fa\u021b\u0103 (Taxi Gratis)"
其顯示這樣的「C?r?ile> pe fa??"
代碼,我已經試過
NSString *correctString = [NSString stringWithCString:[ss cStringUsingEncoding:NSUTF8StringEncoding] encoding:NSUTF8StringEncoding];
NSLog(@"%@",correctString);
請幫助我爲此得到解決辦法。
什麼是 「純文本」?你想如何顯示字符串? –