<?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: iPhone tip #1 &#8211; URL encoding in Objective-C</title>
	<atom:link href="http://www.bagonca.com/blog/2009/04/08/iphone-tip-1-url-encoding-in-objective-c/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bagonca.com/blog/2009/04/08/iphone-tip-1-url-encoding-in-objective-c/</link>
	<description>Yet another developer blog</description>
	<lastBuildDate>Fri, 18 Jun 2010 09:31:55 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: me</title>
		<link>http://www.bagonca.com/blog/2009/04/08/iphone-tip-1-url-encoding-in-objective-c/comment-page-1/#comment-307</link>
		<dc:creator>me</dc:creator>
		<pubDate>Wed, 16 Jun 2010 07:38:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.bagonca.com/blog/?p=100#comment-307</guid>
		<description>be sure to replace the ” with regular quotes when copy &amp; paste this function ... otherwise the compiler will get an error ...</description>
		<content:encoded><![CDATA[<p>be sure to replace the ” with regular quotes when copy &amp; paste this function &#8230; otherwise the compiler will get an error &#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sugiarto</title>
		<link>http://www.bagonca.com/blog/2009/04/08/iphone-tip-1-url-encoding-in-objective-c/comment-page-1/#comment-249</link>
		<dc:creator>sugiarto</dc:creator>
		<pubDate>Mon, 23 Nov 2009 21:56:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.bagonca.com/blog/?p=100#comment-249</guid>
		<description>Thanks,
very help me..</description>
		<content:encoded><![CDATA[<p>Thanks,<br />
very help me..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan J</title>
		<link>http://www.bagonca.com/blog/2009/04/08/iphone-tip-1-url-encoding-in-objective-c/comment-page-1/#comment-235</link>
		<dc:creator>Dan J</dc:creator>
		<pubDate>Wed, 26 Aug 2009 17:02:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.bagonca.com/blog/?p=100#comment-235</guid>
		<description>I think you need to include &quot; in the list of escaped characters.  Don&#039;t forget to escape it in code, e.g. 

CFSTR(”:/?#[]@!$&amp;’()*+,;=\&quot;”)

http://en.wikipedia.org/wiki/Percent-encoding

This was very useful - thanks!</description>
		<content:encoded><![CDATA[<p>I think you need to include &#8221; in the list of escaped characters.  Don&#8217;t forget to escape it in code, e.g. </p>
<p>CFSTR(”:/?#[]@!$&amp;’()*+,;=\&#8221;”)</p>
<p><a href="http://en.wikipedia.org/wiki/Percent-encoding" rel="nofollow">http://en.wikipedia.org/wiki/Percent-encoding</a></p>
<p>This was very useful &#8211; thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Samuel</title>
		<link>http://www.bagonca.com/blog/2009/04/08/iphone-tip-1-url-encoding-in-objective-c/comment-page-1/#comment-34</link>
		<dc:creator>Samuel</dc:creator>
		<pubDate>Mon, 27 Apr 2009 19:09:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.bagonca.com/blog/?p=100#comment-34</guid>
		<description>Thanks, that&#039;s correct! I have edited the post!

+ (NSString *)urlEncodeValue:(NSString *)str
{
	NSString *result = (NSString *) CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (CFStringRef)str, NULL, CFSTR(&quot;:/?#[]@!$&amp;’()*+,;=&quot;), kCFStringEncodingUTF8);
	return [result autorelease];
}</description>
		<content:encoded><![CDATA[<p>Thanks, that&#8217;s correct! I have edited the post!</p>
<p>+ (NSString *)urlEncodeValue:(NSString *)str<br />
{<br />
	NSString *result = (NSString *) CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (CFStringRef)str, NULL, CFSTR(&#8220;:/?#[]@!$&#038;’()*+,;=&#8221;), kCFStringEncodingUTF8);<br />
	return [result autorelease];<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: onitake</title>
		<link>http://www.bagonca.com/blog/2009/04/08/iphone-tip-1-url-encoding-in-objective-c/comment-page-1/#comment-33</link>
		<dc:creator>onitake</dc:creator>
		<pubDate>Mon, 27 Apr 2009 15:55:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.bagonca.com/blog/?p=100#comment-33</guid>
		<description>unfortunately, this will not correctly escape characters reserved as uri part delimiters or sub-part delimiters.
if you want to do that roll your own converter or use CFURLCreateStringByAddingPercentEscapes instead. as you might already know, corefoundation is toll-free bridged to foundation, so you can just cast between cfstring and nsstring. but don&#039;t forget to release/autorelease.

example:
NSString *encodedString = (NSString *) CFURLCreateStringByAddingPercentEscapes(NULL, (CFStringRef) unencodedString, NULL, NULL, kCFStringEncodingUTF8);

if you want to make it rfc 3986-safe, use the following code:
CFStringRef escapeChars = (CFStringRef) @&quot;:/?#[]@!$&amp;&#039;()*+,;=&quot;;NSString *encodedString = (NSString *) CFURLCreateStringByAddingPercentEscapes(NULL, (CFStringRef) unencodedString, NULL, escapeChars, kCFStringEncodingUTF8);</description>
		<content:encoded><![CDATA[<p>unfortunately, this will not correctly escape characters reserved as uri part delimiters or sub-part delimiters.<br />
if you want to do that roll your own converter or use CFURLCreateStringByAddingPercentEscapes instead. as you might already know, corefoundation is toll-free bridged to foundation, so you can just cast between cfstring and nsstring. but don&#8217;t forget to release/autorelease.</p>
<p>example:<br />
NSString *encodedString = (NSString *) CFURLCreateStringByAddingPercentEscapes(NULL, (CFStringRef) unencodedString, NULL, NULL, kCFStringEncodingUTF8);</p>
<p>if you want to make it rfc 3986-safe, use the following code:<br />
CFStringRef escapeChars = (CFStringRef) @&#8221;:/?#[]@!$&amp;&#8217;()*+,;=&#8221;;NSString *encodedString = (NSString *) CFURLCreateStringByAddingPercentEscapes(NULL, (CFStringRef) unencodedString, NULL, escapeChars, kCFStringEncodingUTF8);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Strömberg</title>
		<link>http://www.bagonca.com/blog/2009/04/08/iphone-tip-1-url-encoding-in-objective-c/comment-page-1/#comment-7</link>
		<dc:creator>Peter Strömberg</dc:creator>
		<pubDate>Wed, 08 Apr 2009 21:06:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.bagonca.com/blog/?p=100#comment-7</guid>
		<description>Ah, an iPhone category. Nice! Could someone explain to me why encoding is such a tricky subject? =)</description>
		<content:encoded><![CDATA[<p>Ah, an iPhone category. Nice! Could someone explain to me why encoding is such a tricky subject? =)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
