• 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 (SOLVED)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: characterAtIndex: method and composite characters (SOLVED)


  • Subject: Re: characterAtIndex: method and composite characters (SOLVED)
  • From: Douglas Davidson <email@hidden>
  • Date: Wed, 4 Apr 2007 12:04:00 -0700


On Apr 4, 2007, at 11:55 AM, Ewan Delanoy wrote:


Thanks Douglas for your post ; it completes Greg's one well. The additional information you provide will certainly be useful for me, although not this time : the particular case I was dealing with here was a line-sorter (to sort an index) based on an unusual character ordering (some items in the index start with accentuated characters), which is exactly the kind of "special circumstances" you mention.

For sorting I would generally recommend one of the NSString methods with "compare" in their names; they will properly handle Unicode- conformant comparison. If you are sorting user-visible strings, it's usually best to use the user's preferred sort ordering, which the locale-sensitive compare methods will do. Sort ordering generally can be quite complicated--for example, some locales treat certain pairs of ordinary characters as one for the purposes of sorting--so it's best to let NSString do the work. I wouldn't call the presence of accented characters an unusual circumstance; in most European languages, accented characters are quite common, and may themselves have special sorting rules.


Douglas Davidson

_______________________________________________

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


  • Follow-Ups:
    • Re: characterAtIndex: method and composite characters (SOLVED)
      • From: "Ewan Delanoy" <email@hidden>
    • Re: characterAtIndex: method and composite characters (SOLVED)
      • From: Jerry Krinock <email@hidden>
References: 
 >characterAtIndex: method and composite characters (From: "Ewan Delanoy" <email@hidden>)
 >Re: characterAtIndex: method and composite characters (From: Douglas Davidson <email@hidden>)
 >Re: characterAtIndex: method and composite characters (SOLVED) (From: "Ewan Delanoy" <email@hidden>)

  • Prev by Date: Re: characterAtIndex: method and composite characters (SOLVED)
  • Next by Date: textView:shouldChangeTextInRange:replacementString:
  • Previous by thread: Re: characterAtIndex: method and composite characters (SOLVED)
  • Next by thread: Re: characterAtIndex: method and composite characters (SOLVED)
  • Index(es):
    • Date
    • Thread