• 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
NSString comparison with locale single character error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSString comparison with locale single character error


  • Subject: NSString comparison with locale single character error
  • From: Conor Dearden <email@hidden>
  • Date: Wed, 15 Nov 2006 14:03:57 +0100

I have a problem I can't seem to get around. The letter A and Ä in German
are sorted equally as part of A. "Ärzte" belongs between "Arsene" and "
Astronaut".  When using localizedCompare: or compare:options:range:locale: I
get the correct results when sorting the words, meaning that A and Ä are
NSOrderedSame and the results are based on the second or third letters in
the word. My problem is when comparing the single letters "A" and " Ä" I get
that A belongs before Ä and do not get NSOrderedSame.

I am taking the sorted list and creating an alphabetical index by comparing
only the first letter. The above problem causes the index to be A Ä A Ä A
because there are some intervening words that start with Ä in the A's.

I was wondering if anybody knows a method Cocoa or Carbon that does not have
this locale bug or a work around? Removing the accent will not work as Ä is
not part of the A's in other languages.

Regards,
Conor


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: NSString comparison with locale single character error
      • From: David Duncan <email@hidden>
  • Prev by Date: Re: Barcode Scanner project updated for Built-in iSights
  • Next by Date: Re: noobs and document package types
  • Previous by thread: Re: Antw: Core Data PersistentStore woes with SQLite
  • Next by thread: Re: NSString comparison with locale single character error
  • Index(es):
    • Date
    • Thread