【发布时间】:2015-12-22 16:29:57
【问题描述】:
我正在尝试在 UITableViewCell 中显示 JSON 列表。 当我解析我的 JSON 时,我可以看到 UTF8 字符,当我显示 UILabels 时,UTF8 字符串显示错误的值。
这是我的 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);
请帮我解决这个问题。
【问题讨论】:
-
什么是“纯文本”?你希望字符串如何显示?
标签: ios objective-c json utf-8