Guardar texto hebreo en NSUserDefaults devuelve una codificación extraña
Estoy guardando el texto hebreo en NAMutableArray, luego lo guardo en NSUserDefalts, de esta manera:
numOfWallPosts++;
NSString *tempKeyToStore = [NSString stringWithFormat:@"wall_post_%d", numOfWallPosts]; // wall_post_%d
NSMutableArray *tempArray = [[NSMutableArray alloc] init];
[tempArray addObject:currentOwner];
[tempArray addObject:currentTitle];
[tempArray addObject:currentText];
[tempArray addObject:currentDate];
[tempArray addObject:currentTime];
[tempArray addObject:currentImageURL];
[tempArray addObject:currentWallID];
[self.sharedPrefs setObject:tempArray forKey:tempKeyToStore];
[self.sharedPrefs synchronize];
Cuando quiero recuperar el texto hebreo, recibo un texto como este:
Wall messages: (
"\U05de\U05e2\U05e8\U05db\U05ea",
"\U05ea\U05e8\U05d2\U05d9\U05dc \U05e4\U05d9\U05e7\U05d5\U05d3 \U05d4\U05e2\U05d5\U05e8\U05e3",
"\U05d0\U05d6\U05e2\U05e7\U05ea \U05ea\U05e8\U05d2\U05d5\U05dc \U05d1\U05e9\U05e2\U05d4 19:05",
"27/05/13",
"13:16",
"http://blabla......",
9
)
Traté de formatear el texto enUTF8String
, y conNSUTF8StringEncoding
Y todavía recibo el texto de esta manera.
¿Puedo guardar el texto correctamente o codificarlo al hebreo adecuado?
EDITAR: Esto es muy extraño, aunque el texto guardado es extraño, lo retiro y recibo el texto correctamente. Pero cuando los guardo en NSUserDefaults, me muestra esta codificación extraña.
NSString *tempKeyToStore = [NSString stringWithFormat:@"wall_post_%d", indexPath.row];
NSMutableArray *tempArray = [[NSMutableArray alloc] init];
NSLog(@"\n\nWall messages: %@", [self.sharedPrefs objectForKey:tempKeyToStore]);
tempArray = [self.sharedPrefs objectForKey:tempKeyToStore];
NSString *tempOwner = [tempArray objectAtIndex:0];
NSLog(@"\n\nOWNER: %@", tempOwner);