I'm reading a JSON from an URL. It is UTF8 formatted. When I load the UITableView It shows incorrect characters.
Please find attached screenshot at row 2
The code that reads the data is the following:
NSURL *myURL=[NSURL URLWithString:@"http://www.bancariromani.it/cecadm/newClass/modules/rh/index.php?id_cup=15&json=1"];
NSError *error;
NSData *myData=[[NSData alloc]initWithContentsOfURL:myURL];
if(!myData){
return;
}
NSArray *jasonArray=[NSJSONSerialization JSONObjectWithData:myData options:kNilOptions error:&error];
I've also tried this without luck:
NSURL *myURL=[NSURL URLWithString:@"http://www.bancariromani.it/cecadm/newClass/modules/rh/index.php?id_cup=15&json=1"];
NSError *error;
NSString *string = [NSString stringWithContentsOfURL:myURL encoding:NSISOLatin1StringEncoding error:nil];
NSData *myData = [string dataUsingEncoding:NSUTF8StringEncoding];
if(!myData){
return;
}
NSArray *jasonArray=[NSJSONSerialization JSONObjectWithData:myData options:kNilOptions error:&error];
Where I'm i loosing the UTF8 format?
Thanks for helping me
Dario