Uppercasing text as it is entered
Uppercasing text as it is entered
- Subject: Uppercasing text as it is entered
- From: Todd Ransom <email@hidden>
- Date: Thu, 23 Aug 2007 11:51:16 -0700
I have an app with a text view where some of the text needs to be automatically upppercased as it is entered. I do this using a custom attribute and a subclass of NSTextStorage that returns an uppercase version of the text whenever that attribute is found. This works great for English language text but I am running into problems with some unicode characters.
I am using -[NSString uppercaseString] to uppercase the text but I am getting an unexpected result. The German ß character returns "SS" from uppercaseString.
In other cases entering characters using multiple keystrokes does not work with my method. For instance, typing "opt-e e" to enter a é character is broken because of the multiple keystrokes used to enter the character. -[NSString uppercaseString] returns the correct value but my NSTextStorage subclass returns a simple capitol E.
Is the ß thing a bug in NSString? Does anyone have any advice on a better way to uppercase text as it is entered? Remember that not all text should be uppercased, only text with a particular custom attribute applied to it.
thanks in advance,
Todd Ransom
Return Self Software
http://returnself.com/
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden