• 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: Unicode case conversion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unicode case conversion


  • Subject: Re: Unicode case conversion
  • From: Glenn Andreas <email@hidden>
  • Date: Wed, 24 Nov 2004 22:01:38 -0600

At 7:04 PM -0700 11/24/04, Robbie Haertel wrote:
I'm not very knowledgeable about the unichar type.  I need to compare
characters one-by-one so I use the characterAtIndex: from NSString to
get the character and use '==' et al to do the comparison.  However,
in some cases I need to change the unichar to lower and compare them.
What function will do this?  I can't just convert the NSString to
lowercase a priori because I need to maintain the case information in
most cases.  I'm sure there is a simple lower() function that takes a
unichar argument.

Thanks in advance.
Robbie

One of the problems is that the upper/lower case representation of some characters can become more than one character. A classic example is the German "esset" ß (that thing that looks kind of like a B) which is a double-s, which, when capitalized, becomes two "S"'s. And of course there is no easy reverse (since the lowercase version of "SS" becomes "ss" by default).


You could probably extract the single character as a string and send "lower" to that (though this could be expensive if you do it a lot).

What exactly are you trying to accomplish that requires stepping through the characters of a string one at a time and sometimes needing to convert to lowercase? There may well be a better way to handle this...

--
Glenn Andreas                      email@hidden
<http://www.gandreas.com/> oh my!
Mad, Bad, and Dangerous to Know
_______________________________________________
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


References: 
 >Unicode case conversion (From: Robbie Haertel <email@hidden>)

  • Prev by Date: Re: Unicode case conversion
  • Next by Date: Re: Unicode case conversion
  • Previous by thread: Re: Unicode case conversion
  • Next by thread: Re: Unicode case conversion
  • Index(es):
    • Date
    • Thread