Re: URL Escaping weirdness
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