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

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

  • Follow-Ups:
    • Re: URL Escaping weirdness
      • From: mmalcolm crawford <email@hidden>
    • Re: URL Escaping weirdness
      • From: Ricky Sharp <email@hidden>
  • Prev by Date: Re: loop efficiency & messages
  • Next by Date: Re: URL Escaping weirdness
  • Previous by thread: Re: sorting on multiple columns of a table
  • Next by thread: Re: URL Escaping weirdness
  • Index(es):
    • Date
    • Thread