Sorting unicode strings
Sorting unicode strings
- Subject: Sorting unicode strings
- From: Ricky Sharp <email@hidden>
- Date: Wed, 29 Dec 2004 14:58:07 -0600
My upcoming product, while not initialially localized, will allow users to enter in unicode for names of students. One such area of my UI displays a list of these names and I'd like the them to be reasonably sorted.
To see what Finder did, I created several folders with various text (English, Japanese, Chinese, etc.).
I then created a simple app that built instances of NSString with the folder names and sorted them with NSString's compare:options: I used NSLiteralSearch for the options param. The results almost gave me the same as what Finder did.
In searching Google, I ran into a posting on this list (May 2002) that mentioned the use of UCCompareTextDefault with various options flags. The goal was to mimic what Finder does.
While I can certainly use that code, I wanted to first find out how others are dealing with sorting their strings. Do you keep things "simple" and just use NSString's compare:, or do you take a more elaborate approach and attempt to mimic the Finder?
I'm also thinking of writing an enhancement request to add in a new option flag say named NSFinderSearch. That option of course would mimic what Finder does and may be of some help to app developers.
Thoughts?
--
Rick Sharp
Instant Interactive(tm)
_______________________________________________
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