Rohit
Rohit

Reputation: 7161

NSString isEqualToString: does not equates korean language.

Developing iOS5 based cocoa app, below peice of comparison works fine if localization is English, but fails if localization is Korean.

 //title is of type NSString

 if([title isEqualToString:NSLocalizedString(@"Power",@"Power")])

in korean title and localized string is same visibly.

does isEqualToString: doesnot match Korean/unicode strings?

Upvotes: 0

Views: 559

Answers (2)

shannoga
shannoga

Reputation: 19869

Just a guess.

I assume that it does not work in English to, but since you are using the english words in your NSLocalizedString() the app uses them is default and that's what make you think it works. The problem should be elsewhere.

Check if :

          NSLog(@"localized power = %@",NSLocalizedString(@"Power",@"Power"));

returns the korean translation.

Upvotes: 2

Caleb
Caleb

Reputation: 125007

You might get better results using NSString's localized comparison methods: -localizedCaseInsensitiveCompare:, -localizedCompare:, or -localizedStandardCompare:.

Upvotes: 2

Related Questions