• 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: "Michael Terence Mulligan" <email@hidden>
  • Date: Sat, 26 Mar 2005 17:51:17 -0500 (EST)
  • Importance: Normal

I failed to mention that I'd actually tried those approaches as well:
* casting strings for CF calls
* replacing the @"+&" with NULL
* trying 0 or NULL
* trying kCFAllocatorDefault or NULL

Sadly no difference...they all return the same, incorrect string :-(

-Mike

> 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: Ondra Cada <email@hidden>
References: 
 >URL Escaping weirdness (From: "Michael Terence Mulligan" <email@hidden>)
 >Re: URL Escaping weirdness (From: Ricky Sharp <email@hidden>)

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