Zapisywanie tekstu hebrajskiego w NSUserDefaults zwraca dziwne kodowanie
Zapisuję hebrajski tekst do NAMutableArray, a następnie zapisuję go w NSUserDefalts, w ten sposób:
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];
Kiedy chcę odzyskać hebrajski tekst, otrzymuję tekst w ten sposób:
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
)
Próbowałem sformatować tekst wUTF8String
, i zNSUTF8StringEncoding
i nadal otrzymuję tekst w ten sposób.
Czy mogę zapisać tekst w odpowiedni sposób lub zakodować go z powrotem do właściwego języka hebrajskiego?
EDYTOWAĆ: To jest takie dziwne, chociaż tekst zapisał się dziwnie, cofam go i dostaję tekst poprawnie. Ale kiedy zapisuję je w NSUserDefaults, pokazuje mi to dziwne kodowanie.
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);