• 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: inconsistent behavior of NSString's localizedCaseInsensitiveCompare
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: inconsistent behavior of NSString's localizedCaseInsensitiveCompare


  • Subject: Re: inconsistent behavior of NSString's localizedCaseInsensitiveCompare
  • From: Quincey Morris <email@hidden>
  • Date: Sat, 05 May 2012 16:59:00 -0700

On May 5, 2012, at 15:43 , Martin Wierschin wrote:

> All comparisons, including those used for the original sorting, were done using the same comparison method/locale. And the sort order and search order need to be same, otherwise any algorithms that rely on the transitive nature of comparisons (eg: quicksort, binary search, etc) will fail.

Well, I guess you demonstrated that your particular comparison wasn't transitive.

FWIW, I just tried it in the debugger on my US-locale 10.7.3, and I get:

(lldb) p (NSComparisonResult)[@"laßt" localizedCaseInsensitiveCompare:@"laso"]
(NSComparisonResult) $11 = 1

It's starting to look like a bug in 10.6.8, except that I have no idea why you & I got different answers in 10.7.3.


_______________________________________________

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: 
 >inconsistent behavior of NSString's localizedCaseInsensitiveCompare (From: Martin Wierschin <email@hidden>)
 >Re: inconsistent behavior of NSString's localizedCaseInsensitiveCompare (From: Quincey Morris <email@hidden>)
 >Re: inconsistent behavior of NSString's localizedCaseInsensitiveCompare (From: Martin Wierschin <email@hidden>)

  • Prev by Date: Re: Strange issue in stroking a bezier path
  • Next by Date: Re: inconsistent behavior of NSString's localizedCaseInsensitiveCompare
  • Previous by thread: Re: inconsistent behavior of NSString's localizedCaseInsensitiveCompare
  • Next by thread: Re: inconsistent behavior of NSString's localizedCaseInsensitiveCompare
  • Index(es):
    • Date
    • Thread