Re: Unicode case conversion
Re: Unicode case conversion
- Subject: Re: Unicode case conversion
- From: Robbie Haertel <email@hidden>
- Date: Wed, 24 Nov 2004 21:37:52 -0700
Levenshtein edit distance of a Mayan language. Have to compare each
character one-by-one. The old Spanish priest often writes b, u, and w
as 'V', but this is one of the few cases (there are a few others) I
want to change the case. I'm already necessarily comparing
character-by-character due to the algorithm, so it isn't a problem. I
can already guarantee that there will be no fancy characters other
than "option-3" (the English pound symbol). It may seem like just
checking for 'V' is an option, but it is more complicated than that.
There are some carbon functions, I believe, but I don't know anything
about carbon. Also, I think there are some functions for wide
characters, but I don't think it is the same thing.
Thanks,
robbie
On Wed, 24 Nov 2004 22:01:38 -0600, Glenn Andreas <email@hidden> wrote:
> 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