I want to program my own Eng-Rus dictionary with personalised entries. Studying the topic I wrote this method (in the purpose of learning) - and I cannot output the NSMutableDictionary in Russian TO CONSOLE. Look at the code and the console output. I've tried to disable LLDB to GDB with no luck. The encoding pref is UTF8 (xcode 4.6.3). So, I think I have a "programmer" issue - i.e I just don't know something. I still learning, so need your help, friends...
-(NSString*) dicto
{
NSString *vic;
NSMutableDictionary *dictos = [[NSMutableDictionary alloc]initWithCapacity:10] ;
[dictos setValue:@"кошка" forKey:@"cat"]; //at the console output below NO Russian
[dictos setValue:@"dog" forKey:@"собака"]; //at the console output below NO Russian
NSArray *final=[dictos allKeys];
id vid =[final objectAtIndex:1];
NSLog(@"vid is %@",vid); // prints in Russian
NSLog(@"%@", dictos); //this line probably has an issue
vic=vid;
return vic; //the label.text in sender (=iphone simulator) prints Russian
}
Console Output (lower window in XCode)
2013-08-04 23:20:33.958 helloWorldToConsolFromNSLog[17718:c07] vid is собака
2013-08-04 23:20:33.958 helloWorldToConsolFromNSLog[17718:c07] {
cat = "U043aU043eU0448U043aU0430";
"U0441U043eU0431U0430U043aU0430" = dog;
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…