On May 5, 2012, at 3:43 PM, Martin Wierschin <mar...@nisus.com> wrote:

>> If I'm right, then sort order and search order are different, and you can't 
>> expect to use a binary search here. (Not unless you originally used 
>> pair-wise 'localizedCaseInsensitiveCompare' to manually sort the list of 
>> strings.)
> 
> 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.

If I understand Quincey correctly, that's exactly what he's saying: the 
semantics of localizedCaseInsensitiveCompare: might be such that it is not 
appropriate for such algorithms.

i18n is tricky. It might be worth consulting the Unicode docs on collation.

--Kyle Sluder
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to