• 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: Exact behavior of NSLiteralSearch in string compare?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Exact behavior of NSLiteralSearch in string compare?


  • Subject: Re: Exact behavior of NSLiteralSearch in string compare?
  • From: Mike Abdullah <email@hidden>
  • Date: Wed, 17 Aug 2011 01:13:32 +0100

I'm pretty sure that's what NSLiteralSearch does. In practice for me, I found the difference is that composed/decomposed character sequences are scene as being the same when using compare with no options, but that there's a difference when using NSLiteralSearch (and by extension, -isEqualToString:)

On 16 Aug 2011, at 17:44, Jens Alfke wrote:

> Anyone know what the exact behavior of NSLiteralSearch is when calling -[NSString compare:options:]?
>
> I need to sort an array of NSStrings, with the ordering based on a raw comparison of UTF-16 character values*. That is, sorting the strings as though they were just arrays of UInt16, instead of using any kind of Unicode smarts or locale-specific settings. It sounds as though NSLiteralSearch does that, but the docs don’t actually spell it out.
>
> —Jens
>
> * Why? To produce canonicalized JSON. See <http://wiki.apache.org/couchdb/SignedDocuments>_______________________________________________
>
> 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

_______________________________________________

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

References: 
 >Exact behavior of NSLiteralSearch in string compare? (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: clipping and scrolling
  • Next by Date: Re: Problems with UIAlertView
  • Previous by thread: Exact behavior of NSLiteralSearch in string compare?
  • Next by thread: How can I prevent drag-and-drop initiation in an NSTextField
  • Index(es):
    • Date
    • Thread