Localized string compare borked?
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.