<?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: Percent Escapes Gotcha</title>
	<atom:link href="http://vgable.com/blog/2009/04/10/percent-escapes-gotcha/feed/" rel="self" type="application/rss+xml" />
	<link>http://vgable.com/blog/2009/04/10/percent-escapes-gotcha/</link>
	<description>my weblog.</description>
	<lastBuildDate>Wed, 17 Mar 2010 19:41:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Vincent Gable</title>
		<link>http://vgable.com/blog/2009/04/10/percent-escapes-gotcha/comment-page-1/#comment-621</link>
		<dc:creator>Vincent Gable</dc:creator>
		<pubDate>Sun, 12 Apr 2009 00:26:57 +0000</pubDate>
		<guid isPermaLink="false">http://vgable.com/blog/2009/04/10/percent-escapes-gotcha/#comment-621</guid>
		<description>&quot;What’s wrong with just using the normal encode/decode functions and being careful to use each once? &quot;

I don&#039;t like being careful if I don&#039;t have to :-).  But seriously, if I go down that route I will probably make a &lt;code&gt;PercentEscapedNSString&lt;/code&gt; object, that just holds an &lt;code&gt;NSString&lt;/code&gt; and on creation percent-escapes whatever string it&#039;s given. That way &lt;strong&gt;I can let the type-system make sure I&#039;m doing things right&lt;/strong&gt;.</description>
		<content:encoded><![CDATA[<p>&#8220;What’s wrong with just using the normal encode/decode functions and being careful to use each once? &#8221;</p>
<p>I don&#8217;t like being careful if I don&#8217;t have to :-).  But seriously, if I go down that route I will probably make a <code>PercentEscapedNSString</code> object, that just holds an <code>NSString</code> and on creation percent-escapes whatever string it&#8217;s given. That way <strong>I can let the type-system make sure I&#8217;m doing things right</strong>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vincent Gable</title>
		<link>http://vgable.com/blog/2009/04/10/percent-escapes-gotcha/comment-page-1/#comment-620</link>
		<dc:creator>Vincent Gable</dc:creator>
		<pubDate>Sun, 12 Apr 2009 00:20:43 +0000</pubDate>
		<guid isPermaLink="false">http://vgable.com/blog/2009/04/10/percent-escapes-gotcha/#comment-620</guid>
		<description>Good catch Jason, if someone types in something that has a valid percent escape, eg &quot;cat%20dog&quot;, then I will &lt;em&gt;incorrectly&lt;/em&gt; un-encode it it into &quot;cat dog&quot; by &lt;code&gt; stringByReplacingPercentEscapesOnce&lt;/code&gt; and send a URL with &quot;cat%20dog&quot; &lt;em&gt;not&lt;/em&gt; &quot;cat%2520dog&quot;.

My &lt;a href=&quot;http://vgable.com/blog/2009/04/10/pre-announcing-prometheus/&quot; rel=&quot;nofollow&quot;&gt;application&lt;/a&gt; takes text typed into a search-box, and builds a search-URL from it.  It also takes the URL of a wikipedia page, extracts the page name from it, un-mangles it, and puts it in the search box (which conceptually acts like the URL/search bar in &lt;a href=&quot;http://www.google.com/chrome&quot; rel=&quot;nofollow&quot;&gt;Chrome&lt;/a&gt;.) Wikipedia has a nice property that if your search-string matches a page name, you go right to that page name.

So I&#039;m not sure if this is anything but an academic problem, unless there are page names that have percent-escapes in their real name.

Still, it looks like I probably will not be reusing these functions anytime soon.</description>
		<content:encoded><![CDATA[<p>Good catch Jason, if someone types in something that has a valid percent escape, eg &#8220;cat%20dog&#8221;, then I will <em>incorrectly</em> un-encode it it into &#8220;cat dog&#8221; by <code> stringByReplacingPercentEscapesOnce</code> and send a URL with &#8220;cat%20dog&#8221; <em>not</em> &#8220;cat%2520dog&#8221;.</p>
<p>My <a href="http://vgable.com/blog/2009/04/10/pre-announcing-prometheus/" rel="nofollow">application</a> takes text typed into a search-box, and builds a search-URL from it.  It also takes the URL of a wikipedia page, extracts the page name from it, un-mangles it, and puts it in the search box (which conceptually acts like the URL/search bar in <a href="http://www.google.com/chrome" rel="nofollow">Chrome</a>.) Wikipedia has a nice property that if your search-string matches a page name, you go right to that page name.</p>
<p>So I&#8217;m not sure if this is anything but an academic problem, unless there are page names that have percent-escapes in their real name.</p>
<p>Still, it looks like I probably will not be reusing these functions anytime soon.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason Petersen</title>
		<link>http://vgable.com/blog/2009/04/10/percent-escapes-gotcha/comment-page-1/#comment-619</link>
		<dc:creator>Jason Petersen</dc:creator>
		<pubDate>Sat, 11 Apr 2009 22:34:45 +0000</pubDate>
		<guid isPermaLink="false">http://vgable.com/blog/2009/04/10/percent-escapes-gotcha/#comment-619</guid>
		<description>My inability to read Obj-C syntax prevents me from understanding your method. How exactly can an idempotent version of an encoder without making some heuristic assumption about what &#039;encoded&#039; looks like? I mean if someone has a fairly simple string it&#039;s fairly easy, but what if I WANT to encode this string:

&quot;100% escaped once: 100%25, escaped twice: 100%2525&quot;

to be properly sendable in a URL. What&#039;s wrong with just using the normal encode/decode functions and being careful to use each once? Outgoing, encoding needs to be the last thing you do. Incoming, decoding is the first.</description>
		<content:encoded><![CDATA[<p>My inability to read Obj-C syntax prevents me from understanding your method. How exactly can an idempotent version of an encoder without making some heuristic assumption about what &#8216;encoded&#8217; looks like? I mean if someone has a fairly simple string it&#8217;s fairly easy, but what if I WANT to encode this string:</p>
<p>&#8220;100% escaped once: 100%25, escaped twice: 100%2525&#8243;</p>
<p>to be properly sendable in a URL. What&#8217;s wrong with just using the normal encode/decode functions and being careful to use each once? Outgoing, encoding needs to be the last thing you do. Incoming, decoding is the first.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
