<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: URL Encoding</title>
	<atom:link href="http://objcolumnist.com/2009/10/25/escaping-a-url/feed/" rel="self" type="application/rss+xml" />
	<link>http://objcolumnist.com/2009/10/25/escaping-a-url/</link>
	<description>Coding under the Hammer</description>
	<lastBuildDate>Mon, 02 Apr 2012 21:02:38 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
	<item>
		<title>By: Spencer MacDonald</title>
		<link>http://objcolumnist.com/2009/10/25/escaping-a-url/comment-page-1/#comment-847</link>
		<dc:creator>Spencer MacDonald</dc:creator>
		<pubDate>Thu, 21 Apr 2011 18:57:19 +0000</pubDate>
		<guid isPermaLink="false">http://objcolumnist.com/?p=137#comment-847</guid>
		<description>Looking at the MKBitlyHelper source code, it escapes the URL that you parse to it before sending it off to bit.ly. 

This means that your escaping an already escaped URL, which is likely to be the cause of your problems.</description>
		<content:encoded><![CDATA[<p>Looking at the MKBitlyHelper source code, it escapes the URL that you parse to it before sending it off to bit.ly. </p>
<p>This means that your escaping an already escaped URL, which is likely to be the cause of your problems.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dominic</title>
		<link>http://objcolumnist.com/2009/10/25/escaping-a-url/comment-page-1/#comment-846</link>
		<dc:creator>Dominic</dc:creator>
		<pubDate>Thu, 21 Apr 2011 07:52:57 +0000</pubDate>
		<guid isPermaLink="false">http://objcolumnist.com/?p=137#comment-846</guid>
		<description>This does not work when using with MKBitlyHelper..</description>
		<content:encoded><![CDATA[<p>This does not work when using with MKBitlyHelper..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Spencer MacDonald</title>
		<link>http://objcolumnist.com/2009/10/25/escaping-a-url/comment-page-1/#comment-529</link>
		<dc:creator>Spencer MacDonald</dc:creator>
		<pubDate>Tue, 23 Mar 2010 19:40:06 +0000</pubDate>
		<guid isPermaLink="false">http://objcolumnist.com/?p=137#comment-529</guid>
		<description>Thanks Bill,

I noticed this the other day when I did static analysis on one of my projects, but I forgot I did a blog post on it. I have updated the code snippet to the one I know use in my projects.</description>
		<content:encoded><![CDATA[<p>Thanks Bill,</p>
<p>I noticed this the other day when I did static analysis on one of my projects, but I forgot I did a blog post on it. I have updated the code snippet to the one I know use in my projects.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill</title>
		<link>http://objcolumnist.com/2009/10/25/escaping-a-url/comment-page-1/#comment-528</link>
		<dc:creator>Bill</dc:creator>
		<pubDate>Tue, 23 Mar 2010 12:19:36 +0000</pubDate>
		<guid isPermaLink="false">http://objcolumnist.com/?p=137#comment-528</guid>
		<description>This category method is an elegant solution and I&#039;ve got a place where I can use it.  Thanks!</description>
		<content:encoded><![CDATA[<p>This category method is an elegant solution and I&#8217;ve got a place where I can use it.  Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill</title>
		<link>http://objcolumnist.com/2009/10/25/escaping-a-url/comment-page-1/#comment-527</link>
		<dc:creator>Bill</dc:creator>
		<pubDate>Tue, 23 Mar 2010 12:15:42 +0000</pubDate>
		<guid isPermaLink="false">http://objcolumnist.com/?p=137#comment-527</guid>
		<description>CFURLCreateStringByAddingPercentEscapes() creates an object whose memory you need to manage explicitly.  It behaves like malloc() or [[NSString alloc] init]:  the memory for the thing returned has to be freed by the caller or you get a leak.

The implementation above will leak two CFStringRefs every time it&#039;s called.


CFStringRef *encoded = CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (CFStringRef)[parameters valueForKey:key], NULL, CFSTR(&quot;:/?#[]@!$&amp;’()*+,;=&quot;), kCFStringEncodingUTF8);

[urlString appendFormat:@&quot;?%@=%@&quot;,key, encoded];

CFRelease(encoded);


Using CoreFoundation objects always seems to add a lot of noise to otherwise clean code.  I guess that&#039;s the price we pay, though.</description>
		<content:encoded><![CDATA[<p>CFURLCreateStringByAddingPercentEscapes() creates an object whose memory you need to manage explicitly.  It behaves like malloc() or [[NSString alloc] init]:  the memory for the thing returned has to be freed by the caller or you get a leak.</p>
<p>The implementation above will leak two CFStringRefs every time it&#8217;s called.</p>
<p>CFStringRef *encoded = CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (CFStringRef)[parameters valueForKey:key], NULL, CFSTR(&#8220;:/?#[]@!$&amp;’()*+,;=&#8221;), kCFStringEncodingUTF8);</p>
<p>[urlString appendFormat:@"?%@=%@",key, encoded];</p>
<p>CFRelease(encoded);</p>
<p>Using CoreFoundation objects always seems to add a lot of noise to otherwise clean code.  I guess that&#8217;s the price we pay, though.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

