文字列を使用してplistを作成しました。文字列の中にウムラウトがあり、正しく表示されるようにエンコードできません。私のコードは次のようになります:
NSString *myFile = [[NSBundle mainBundle] pathForResource:@"LevelText" ofType:@"plist"];
strings = [[NSDictionary alloc] initWithContentsOfFile:myFile ];
stringkeys = [strings allKeys];
NSEnumerator *enumerator = [strings objectEnumerator];
while (value = [enumerator nextObject]) {
if(![value isEqualToString:@""]){
NSString *right = [NSString stringWithCString:value.UTF8String encoding: NSUTF8StringEncoding];
NSLog(@"Value: %s", right.UTF8String);
}
}
plistをNSDictionaryオブジェクトにロードし、それを列挙します。私はstackoverflowの別の例も調べましたが、そのようには機能しません。ウムラウトは常に次のように表されます。
anhören