Re: inconsistent behavior of NSString's localizedCaseInsensitiveCompare
Re: inconsistent behavior of NSString's localizedCaseInsensitiveCompare
- Subject: Re: inconsistent behavior of NSString's localizedCaseInsensitiveCompare
- From: "Stephen J. Butler" <email@hidden>
- Date: Sat, 05 May 2012 19:03:43 -0500
On Sat, May 5, 2012 at 6:53 PM, Jens Alfke <email@hidden> wrote:
>
> On May 5, 2012, at 3:18 PM, Quincey Morris wrote:
>
>> "ß" within a string probably compares equal to "ss" at the corresponding position, independently of the language. (This makes sense, I think.) Therefore "laßt" > "lasso" always.
>
> I don’t know about this specific case, but these rules definitely vary by locale — there are cases where two languages use the same letter but disagree about how it sorts. (For example, the rules for sorting “LL” in Spanish are not the same as in English.)
I don't know a whole lot about Cocoa support for locales. Is
stringByFoldingWithOptions:locale: similar to strxfrm_l? Because if so
I would feel reasonable comfortable doing a binary search on strings
ordered after being transformed by this function.
But they wouldn't be suitable for display. So you'd have to store the
original string somewhere.
_______________________________________________
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