• 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: "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


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: Jens Alfke <email@hidden>)

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