• 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: URL Escaping weirdness
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: URL Escaping weirdness


  • Subject: Re: URL Escaping weirdness
  • From: Ricky Sharp <email@hidden>
  • Date: Sat, 26 Mar 2005 16:33:25 -0600

On Mar 26, 2005, at 3:57 PM, Michael Terence Mulligan wrote:

So I added an NSString category with a number of URL/web-centric methods,
one of them being:
-(NSString *)escapeURL
{
CFURLCreateStringByAddingPercentEscapes(0, self, 0, @"+&",
kCFStringEncodingUTF8);
}

I believe the problem is with the fourth parameter. I don't know what the compiler will generate if you pass in @"+&" to a function that takes a CFStringRef even though CFString and NSString are toll-free bridged. Perhaps pass CFSTR("+&") instead.


Also, rather than passing in 0 for the first parameter, pass in NULL or kCFAllocatorDefault. The third parameter should also be a NULL. While 0 will work, it's always better, IMO, to use named constants or nil/NULL.

Finally, I believe the actual implementation of the function returns the string?

___________________________________________________________
Ricky A. Sharp         mailto:email@hidden
Instant Interactive(tm)   http://www.instantinteractive.com

_______________________________________________
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


  • Follow-Ups:
    • Re: URL Escaping weirdness
      • From: "Michael Terence Mulligan" <email@hidden>
References: 
 >URL Escaping weirdness (From: "Michael Terence Mulligan" <email@hidden>)

  • Prev by Date: URL Escaping weirdness
  • Next by Date: NSImageView Scaling oddity
  • Previous by thread: URL Escaping weirdness
  • Next by thread: Re: URL Escaping weirdness
  • Index(es):
    • Date
    • Thread