Re: -[NSString localizedCompare:] - example of semantic difference with compare?
Re: -[NSString localizedCompare:] - example of semantic difference with compare?
- Subject: Re: -[NSString localizedCompare:] - example of semantic difference with compare?
- From: Aki Inoue <email@hidden>
- Date: Mon, 27 Mar 2006 14:09:41 -0800
Ricky,
CFComparisonResult theCFResult = CFStringCompareWithOptions
((CFStringRef) self,
(CFStringRef) anItemName, CFRangeMake (0, CFStringGetLength
((CFStringRef) self)),
kCFCompareCaseInsensitive | kCFCompareLocalized |
kCFCompareNumerically);
I recommend also using kCFCompareNonliteral here. Without it,
CFString doesn't compare attached and detached accents equally which
is essential to most localized sorting.
You might want to file a bug against NSString to add either
localizedCompare:withOptions:, or to add a NSLocalizedSearch option.
Will definitely do this tonight; I'll actually request both options
just for completeness sake.
The API actually exists.
Refer to -[NSString compare:options:range:locale:].
Aki
_______________________________________________
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