Salvando texto em hebraico para NSUserDefaults retorna codificação estranha
Estou salvando o texto em hebraico para NAMutableArray e, em seguida, salvei-o em NSUserDefalts, desta forma:
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];
Quando eu quero pegar o texto hebraico de volta, recebo um texto assim:
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
)
Eu tentei formatar o texto emUTF8String
, e comNSUTF8StringEncoding
e ainda recebo o texto dessa maneira.
Posso salvar o texto da maneira correta ou codificá-lo de volta ao hebraico adequado?
EDITAR: Isso é tão estranho, embora o texto tenha sido salvo de forma estranha, eu o puxo de volta e recebo o texto corretamente. Mas quando eu os salvo em NSUserDefaults, isso me mostra essa estranha codificação.
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);