<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Tatva-Artha &#187; html</title>
	<atom:link href="http://www.tatvartha.com/tag/html/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tatvartha.com</link>
	<description>meaning of &#34;it&#34;</description>
	<lastBuildDate>Sat, 22 Oct 2011 22:00:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>CGI escape, unescape, escapeHTML, unescapeHTML</title>
		<link>http://www.tatvartha.com/2009/05/cgi-escape-unescape-escapehtml-unescapehtml/</link>
		<comments>http://www.tatvartha.com/2009/05/cgi-escape-unescape-escapehtml-unescapehtml/#comments</comments>
		<pubDate>Thu, 21 May 2009 14:19:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[URL]]></category>

		<guid isPermaLink="false">http://www.tatvartha.com/?p=146</guid>
		<description><![CDATA[I just can&#8217;t seem to remember which to use when so here are the 4 great helpers when working with URLs and HTML: When constructing URLs, you use escape and unescape: url = "http://site.com/?address=" + CGI.escape("123 Main St, City, ST, 99999") # url: http://example.com/?address=123+Main+St%2C+City%2C+ST%2C+99999 unescape does the reverse. When rendering text inside HTML page, you [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>I just can&#8217;t seem to remember which to use when so here are the 4 great helpers when working with URLs and HTML:</p>
<p>When constructing <strong>URLs</strong>, you use <code>escape</code> and <code>unescape:</code></p>
<pre>
<span class="n">url</span> <span class="o">=</span> <span class="s2">"http://site.com/?address="</span> <span class="o">+</span> <span class="no">CGI</span><span class="o">.</span><span class="n">escape</span><span class="p">(</span><span class="n">"123 Main St, City, ST, 99999"</span><span class="p">)</span>
<span class="c1"># url: http://example.com/?address=123+Main+St%2C+City%2C+ST%2C+99999</span>
</pre>
<p>unescape does the reverse.</p>
<p>When rendering text inside <strong>HTML</strong> page, you use <code>escapeHTML</code> and <code>unescapeHTML</code>:</p>
<p><code>raw_html = CGI::escapeHTML("&lt;div&gt;An example HTML to be displayed raw on an HTML page&lt;/div&gt;") #raw_html: &amp;lt;div&amp;gt;An example HTML to be displayed raw on an HTML page&amp;lt;/div&amp;gt;</code></p>
<p>unescapeHTML is for converting an html-escaped string back to proper HTML form.</p>
<p>Simple, but you often forget! <br/></p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.tatvartha.com/2009/05/cgi-escape-unescape-escapehtml-unescapehtml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

