URL Escaping weirdness
URL Escaping weirdness
- Subject: URL Escaping weirdness
- From: "Michael Terence Mulligan" <email@hidden>
- Date: Sat, 26 Mar 2005 16:57:18 -0500 (EST)
- Importance: Normal
Hey all,
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);
}
However, it fails really simple test cases, i.e. (notice the space in
"news story")
NSLog([@"www.example.com/news story/index.htm" escapeURL]);
this SHOULD output:
"www.example.com/news story/index.htm"
but in reality, it outputs:
"www.example.com/news tory/index.htm"
(in case the email gets processed in a funny way, there are about twenty
spaces after "news" and notice that the "s" in "story" is missing)
This is driving me nuts. Any ideas what's going on or am I just
misunderstanding what the CFURLCre...Escapes function is for?
Thanks in advance!
-Mike
_______________________________________________
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