• 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: searching a Unicode string in a text
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: searching a Unicode string in a text
      • From: Ondra Cada <email@hidden>
References: 
 >Re: searching a Unicode string in a text (From: Ondra Cada <email@hidden>)

  • Prev by Date: NSView coordinate System
  • Next by Date: NSTextStorage setAttributedString problems
  • Previous by thread: Re: searching a Unicode string in a text
  • Next by thread: Re: searching a Unicode string in a text
  • Index(es):
    • Date
    • Thread