• 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: Converting String Representations at Runtime
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Converting String Representations at Runtime


  • Subject: Re: Converting String Representations at Runtime
  • From: Michael Ash <email@hidden>
  • Date: Sun, 12 Apr 2009 23:01:28 -0400

On Sun, Apr 12, 2009 at 10:51 PM, Ken Thomases <email@hidden> wrote:
> The above is failing to take into account the assumed knowledge that the
> code points won't be more than 4 characters long.  What if you follow a
> \uNNNN sequence with characters (not intended to be part of the \u sequence)
> in the [0-9a-fA-F] set?  For example, "bar\u0020foo".  -scanHexInt: will
> take that to mean 0x20f.  You'd need to -scanCharactersFromSet:intoString:
> to read a sequence of hexadecimal digits, then check the length and back up
> using -setScanLocation: if it was more than 4 digits.  Also, you'd truncate
> the resulting string at 4 digits and scan _that_ using -scanHexInt:.

It's not so much "failing to account" as it is "assuming you'll set up
the scanner appropriately". Obviously you would not set the scanner to
run on the original source string, that simply wouldn't work, as you
discuss.

Mike
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Converting String Representations at Runtime (From: John Joyce <email@hidden>)
 >Re: Converting String Representations at Runtime (From: Michael Ash <email@hidden>)
 >Re: Converting String Representations at Runtime (From: Ken Thomases <email@hidden>)

  • Prev by Date: Re: Converting String Representations at Runtime
  • Next by Date: [ANN] FeedParser released - an open source Cocoa RSS parser
  • Previous by thread: Re: Converting String Representations at Runtime
  • Next by thread: Re: Converting String Representations at Runtime
  • Index(es):
    • Date
    • Thread