Re: searching a Unicode string in a text
Re: searching a Unicode string in a text
- Subject: Re: searching a Unicode string in a text
- From: Arthur Clemens <email@hidden>
- Date: Fri, 20 Sep 2002 11:36:45 +0200
>
The compiler can't read Unicode char escapes, and that's that. Search
>
archives, this was extensively discussed already.
Well, if you know the words with which to search its easier. But then
you are already so much closer to the answer. Finding the question is
the hardest part.
But I found the thread now :-)
>
If the string is one-char and fixed, the best solution would probably
>
be stringWithCharacters: and a unichar variable; otherwise, the best
>
way to go are localizable strings.
Ok thanks
so I can use
unichar unicharCode = 0x278A; // DINGBAT NEGATIVE CIRCLED
SANS-SERIF DIGIT ONE
NSString *unicharString = [NSString
stringWithCharacters:&unicharCode length:1];
NSRange range = [string rangeOfString:unicharString];
if( range.location == 0 && range.length == [string length] ) return
[[[NSString alloc] initWithString:@"1"] autorelease];
Arthur Clemens
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.