Search code examples
iphoneobjective-cutf-8nsstringnsstringencoding

objective - c lowercaseString


special characters in lowercase letters in a word, failing. sample:

NSLog(@"%@",name);
name = [name lowercaseString];
NSLog(@"%@",name);

2013-06-24 23:32:11.590  Player[12739:907]   BİLİYORSUN..
2013-06-24 23:32:11.590  Player[12739:907]   bi̇li̇yorsun..

2013-06-24 23:36:09.504  Player[12739:907]  İTÜ
2013-06-24 23:36:09.505  Player[12739:907]  i̇tü 

"i" "İ" seem distorted letters. What should I do? thanks.

the output is supposed to be this way: the right thing

2013-06-24 23:36:09.505  Player[12739:907]  itü 
2013-06-24 23:32:11.590  Player[12739:907]  biliyorsun..

Solution

  • You should reference the UTF-8 char table found here. This seems to be normal behavior, as your capital and lowercase 'İ' both are of the type 'I with Grave'.