• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: characterAtIndex: method and composite characters
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: characterAtIndex: method and composite characters


  • Subject: Re: characterAtIndex: method and composite characters
  • From: Greg Titus <email@hidden>
  • Date: Wed, 4 Apr 2007 08:12:25 -0700


On Apr 4, 2007, at 8:05 AM, Ewan Delanoy wrote:
-when an NSString or
NSAttributedString (let's call it s) appears on-screen as, say, "(a with
tilda)(other characters ...)" is
it guaranteed that [s characterAtIndex: 0] will be "a with tilda", and
not "a" (with "tilda" for a second
character) ?


 -If this is not the case, I need a more accurate version of
"characterAtIndex:". Is this already
built-in ?

You want the -precomposedStringWithCanonicalMapping, and - decomposedStringWithCanonicalMapping methods. Depending upon what you mean by "more accurate" (one isn't really any more accurate than the other), you take your original string (which might be either way) and call the precomposed method to get a new string which is guaranteed to be in the "a with tilde" form, or the decomposed method to get a new string which is guaranteed to be in the "a with tilde for second character" form.


Hope this helps,
	- Greg
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


References: 
 >characterAtIndex: method and composite characters (From: "Ewan Delanoy" <email@hidden>)

  • Prev by Date: characterAtIndex: method and composite characters
  • Next by Date: strange problem setting submenu on top level menu item
  • Previous by thread: characterAtIndex: method and composite characters
  • Next by thread: Re: characterAtIndex: method and composite characters
  • Index(es):
    • Date
    • Thread