• 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
Re: Sorting unicode strings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sorting unicode strings


  • Subject: Re: Sorting unicode strings
  • From: Ken Ferry <email@hidden>
  • Date: Thu, 30 Dec 2004 05:33:54 -0500

On Wed, 29 Dec 2004 14:58:07 -0600, Ricky Sharp <email@hidden> wrote:
> 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?

If you're referring to the message at
<http://www.cocoabuilder.com/archive/message/2002/5/22/62842> then be
a little careful:  There's a bug in it.  UCCompareTextDefault does not
expect the string data to begin with a BOM, but there will be if the
data is obtained by calling [string
dataUsingEncoding:NSUnicodeStringEncoding].  Try comparing any two
strings of length one with that code.  You'll get NSOrderedSame.

-Ken
 _______________________________________________
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: Sorting unicode strings
      • From: Ricky Sharp <email@hidden>
References: 
 >Sorting unicode strings (From: Ricky Sharp <email@hidden>)

  • Prev by Date: ANN: pyobjc-1.2
  • Next by Date: Re: OgreKit, onigurama, and named groups
  • Previous by thread: RE: Sorting unicode strings
  • Next by thread: Re: Sorting unicode strings
  • Index(es):
    • Date
    • Thread