• 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
Localized string compare borked?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Localized string compare borked?


  • Subject: Localized string compare borked?
  • From: j o a r <email@hidden>
  • Date: Mon, 19 May 2003 23:26:57 +0200

Hej,

My user want to see their lists sorted in accordance with their Swedish locale. We have extra characters at the end of our alphabet (after Z, wohoo!), but they get sorted among their ASCII siblings A and O no matter what I try.

Included is a shot at a comparison method that I've implemented in one of my objects in futile attempts to get it sorted properly:

- (NSComparisonResult) localizedCaseInsensitiveCompare:(id) obj
{
NSComparisonResult result = NSOrderedSame;

if ([obj isKindOfClass: [self class]])
{
result = [[self stripDisplayName] localizedCaseInsensitiveCompare: [obj stripDisplayName]];
/*
result = [[self stripDisplayName] compare: [obj stripDisplayName]
options: NSCaseInsensitiveSearch
range: NSMakeRange(0, [[self stripDisplayName] length])
locale: [[NSUserDefaults standardUserDefaults] dictionaryRepresentation]];
*/
}

return result;
}

Can you spot the bug, or do you have some other helpful suggestions?

I looked for answers in the docs, at ADC and Mamasam but found very little on the topic. Something missing in Mac OS X 10.2?

Anyone else noted that the Cocoa reference docs seems to be missing from developer.apple.com - an update in the works, or more things borked?

j o a r
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Localized string compare borked?
      • From: Ben Dougall <email@hidden>
    • Re: Localized string compare borked?
      • From: David Remahl <email@hidden>
  • Prev by Date: Re: RE: Events between Objective C objects
  • Next by Date: Re: Speed Traps
  • Previous by thread: Splitview resize a la ProjectBuilder
  • Next by thread: Re: Localized string compare borked?
  • Index(es):
    • Date
    • Thread