NSString to treat “regular english alphabets” and characters like emoji or japanese uniformly
问题 There is a textView in which I can enter Characters. characters can be a,b,c,d etc or a smiley face added using emoji keyboard. -(void)textFieldDidEndEditing:(UITextField *)textField{ NSLog(@"len:%lu",textField.length); NSLog(@"char:%c",[textField.text characterAtIndex:0]); } Currently , The above function gives following outputs if textField.text = @"qq" len:2 char:q if textField.text = @"😄q" len:3 char:= What I need is if textField.text = @"qq" len:2 char:q if textField.text = @"😄q" len:2