Re: inconsistent behavior of NSString's localizedCaseInsensitiveCompare
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