<?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: HttpUtility.UrlEncode Does not encode spaces properly</title>
	<atom:link href="http://ray.jez.net/httputility-urlencode-does-not-encode-spaces-properly/feed/" rel="self" type="application/rss+xml" />
	<link>http://ray.jez.net/httputility-urlencode-does-not-encode-spaces-properly/</link>
	<description>AllThingsR</description>
	<lastBuildDate>Mon, 27 Jun 2011 22:51:30 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: andalib</title>
		<link>http://ray.jez.net/httputility-urlencode-does-not-encode-spaces-properly/comment-page-1/#comment-7963</link>
		<dc:creator>andalib</dc:creator>
		<pubDate>Thu, 04 Feb 2010 12:12:41 +0000</pubDate>
		<guid isPermaLink="false">/jez/archive/2005/01/14/6462.aspx#comment-7963</guid>
		<description>when you are doing HttpUtility.UrlDecode(); if decodes both urlEncode(), and urlPathEncode(). So, d5 should be:
string d5 = HttpUtility.UrlDecode(e5)
it decodes both space and other chars that were encoded by both method.</description>
		<content:encoded><![CDATA[<p>when you are doing HttpUtility.UrlDecode(); if decodes both urlEncode(), and urlPathEncode(). So, d5 should be:<br />
string d5 = HttpUtility.UrlDecode(e5)<br />
it decodes both space and other chars that were encoded by both method.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dan</title>
		<link>http://ray.jez.net/httputility-urlencode-does-not-encode-spaces-properly/comment-page-1/#comment-886</link>
		<dc:creator>dan</dc:creator>
		<pubDate>Fri, 24 Feb 2006 20:17:01 +0000</pubDate>
		<guid isPermaLink="false">/jez/archive/2005/01/14/6462.aspx#comment-886</guid>
		<description>actually, the string &quot;d5&quot; results in this, which is a lot different than above:

&quot;&lt;script%20lang=&#039;javascript&#039;%20/&gt;&quot;

...which takes us back to the start... :(
</description>
		<content:encoded><![CDATA[<p>actually, the string &#8220;d5&#8243; results in this, which is a lot different than above:</p>
<p>&#8220;&lt;script%20lang=&#8217;javascript&#8217;%20/>&#8221;</p>
<p>&#8230;which takes us back to the start&#8230; <img src='http://ray.jez.net/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://ray.jez.net/httputility-urlencode-does-not-encode-spaces-properly/comment-page-1/#comment-885</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Wed, 16 Feb 2005 15:15:00 +0000</pubDate>
		<guid isPermaLink="false">/jez/archive/2005/01/14/6462.aspx#comment-885</guid>
		<description>In my small experiments I have seen the following;
&lt;br /&gt;
&lt;br /&gt;string e   = &quot;&lt;script lang=&#039;javascript&#039; /&gt;&quot;;
&lt;br /&gt;
&lt;br /&gt;string e1 = HttpUtility.HtmlEncode(e);
&lt;br /&gt;string e2 = HttpUtility.UrlEncode(e);
&lt;br /&gt;string e3 = HttpUtility.UrlPathEncode(e);
&lt;br /&gt;string e4 = HttpUtility.HtmlAttributeEncode(e);
&lt;br /&gt;
&lt;br /&gt;and then you get the following results;
&lt;br /&gt;
&lt;br /&gt;e1 = &quot;&lt;script lang=&#039;javascript&#039; /&gt;&quot;
&lt;br /&gt;e2 = &quot;%3cscript+lang%3d&#039;javascript&#039;+%2f%3e&quot;
&lt;br /&gt;e3 = &quot;&lt;script%20lang=&#039;javascript&#039;%20/&gt;&quot;
&lt;br /&gt;e4 = &quot;&lt;script lang=&#039;javascript&#039; /&gt;&quot;
&lt;br /&gt;
&lt;br /&gt;which means you might have to employ to encode;
&lt;br /&gt;
&lt;br /&gt;string e5 = HttpUtility.UrlEncode(HttpUtility.UrlPathEncode(a));
&lt;br /&gt;
&lt;br /&gt;and eventually
&lt;br /&gt;
&lt;br /&gt;string d5 = HttpUtility.UrlDecode(HttpUtility.HtmlDecode(e5))
&lt;br /&gt;
&lt;br /&gt;which gives
&lt;br /&gt;
&lt;br /&gt;e5 = &quot;%3cscript%2520lang%3d&#039;javascript&#039;%2520%2f%3e&quot;
&lt;br /&gt;d5 = &quot;&lt;script lang=&#039;javascript&#039; /&gt;&quot;
&lt;br /&gt;
&lt;br /&gt;to get the &quot;best&quot; result... (I doubt it too..)
&lt;br /&gt;
&lt;br /&gt;Sorry for the cryptic writing... 
&lt;br /&gt;		</description>
		<content:encoded><![CDATA[<p>In my small experiments I have seen the following;</p>
<p>string e   = &#8220;&lt;script lang=&#8217;javascript&#8217; />&#8221;;</p>
<p>string e1 = HttpUtility.HtmlEncode(e);<br />
<br />string e2 = HttpUtility.UrlEncode(e);<br />
<br />string e3 = HttpUtility.UrlPathEncode(e);<br />
<br />string e4 = HttpUtility.HtmlAttributeEncode(e);</p>
<p>and then you get the following results;</p>
<p>e1 = &#8220;&lt;script lang=&#8217;javascript&#8217; /&gt;&#8221;<br />
<br />e2 = &#8220;%3cscript+lang%3d&#8217;javascript&#8217;+%2f%3e&#8221;<br />
<br />e3 = &#8220;&lt;script%20lang=&#8217;javascript&#8217;%20/>&#8221;<br />
<br />e4 = &#8220;&lt;script lang=&#8217;javascript&#8217; />&#8221;</p>
<p>which means you might have to employ to encode;</p>
<p>string e5 = HttpUtility.UrlEncode(HttpUtility.UrlPathEncode(a));</p>
<p>and eventually</p>
<p>string d5 = HttpUtility.UrlDecode(HttpUtility.HtmlDecode(e5))</p>
<p>which gives</p>
<p>e5 = &#8220;%3cscript%2520lang%3d&#8217;javascript&#8217;%2520%2f%3e&#8221;<br />
<br />d5 = &#8220;&lt;script lang=&#8217;javascript&#8217; />&#8221;</p>
<p>to get the &#8220;best&#8221; result&#8230; (I doubt it too..)</p>
<p>Sorry for the cryptic writing&#8230;<br /></p>
]]></content:encoded>
	</item>
</channel>
</rss>

