【发布时间】:2013-12-31 17:14:01
【问题描述】:
我正在尝试加载这个 JSON:
{ 名称:“希伯来语字符串”,
图片:“”,类别:“希伯来语字符串”,
成分:“希伯来字符串”,
价格:“300”},.......
我的代码:
NSURL *url = [[NSURL alloc] initWithString:@"url"];
NSURLRequest *request = [[NSURLRequest alloc] initWithURL:url];
AFJSONRequestOperation *operation = [AFJSONRequestOperation
JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) {
NSLog(@"json = %@",JSON);
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(dataretrived)
name:@"JsonFinishLoading"
object:nil];
}failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, id JSON) {}
数据输出打乱:
Category = "\U05db\U05e8\U05d9\U05da \U05d8\U05d5\U05e0\U05d4";
Image = "";
Ingredients = "\U05d8\U05d5\U05e0\U05d4,\U05e2\U05d2\U05d1\U05e0\U05d9\U05d4";
Name = "\U05db\U05e8\U05d9\U05da \U05d8\U05d5\U05e0\U05d4";
Price = 300;
}....
如何转换数据以使其正确显示?
【问题讨论】:
-
数据刚刚好。它是这样记录的,因为 NSLog 不知道如何显示多字节字符。
-
(昨天在这里问的问题不完全一样吗?)
-
我没有找到帖子,你可以发布链接,
-
当我试图在表格视图中显示时不显示,因此数据不正确。
-
上面的第一个字符是Hebrew letter "kaf"。我很确定他们都没事。
标签: ios objective-c json hebrew