<?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>Gigu's blog &#187; encoding</title>
	<atom:link href="http://blog.gigoo.org/tag/encoding/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.gigoo.org</link>
	<description>wEBbLOG</description>
	<lastBuildDate>Thu, 01 Jul 2010 22:59:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Percent encoding in Groovy</title>
		<link>http://blog.gigoo.org/2010/02/01/percent-encoding-in-groovy/</link>
		<comments>http://blog.gigoo.org/2010/02/01/percent-encoding-in-groovy/#comments</comments>
		<pubDate>Sun, 31 Jan 2010 23:35:46 +0000</pubDate>
		<dc:creator>Greg Gigon</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[encoding]]></category>
		<category><![CDATA[groovy]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://blog.gigoo.org/?p=4860</guid>
		<description><![CDATA[I was writing some helpers for OAuth Twitter authorization. One of the problem I got was the encoding. OAuth is using UTF-8 and percent encoding (special style of URL ecoding).
I couldn&#8217;t find anything build-in in Java or Groovy so I wrote a very short little method that does it.
 def encodeString(def stringToEncode){
 def reservedCaracters = [...]]]></description>
			<content:encoded><![CDATA[<p>I was writing some helpers for OAuth Twitter authorization. One of the problem I got was the encoding. OAuth is using UTF-8 and <a title="Percent encoding" href="http://en.wikipedia.org/wiki/Percent-encoding" onclick="javascript:pageTracker._trackPageview('/outbound/article/en.wikipedia.org');" target="_blank">percent encoding</a> (special style of URL ecoding).</p>
<p>I couldn&#8217;t find anything build-in in Java or Groovy so I wrote a very short little method that does it.</p>
<p><span> </span><em><strong>def encodeString(def stringToEncode){</strong></em></p>
<p><span><em><strong> </strong></em></span><em><strong>def reservedCaracters = [32:1, 33:1, 42:1, 34:1, 39:1, 40:1, 41:1, 59:1, 58:1, 64:1, 38:1, 61:1, 43:1, 36:1, 33:1, 47:1, 63:1, 37:1, 91:1, 93:1, 35:1]</strong></em></p>
<p><span><em><strong> </strong></em></span><em><strong>def encoded =  stringToEncode.collect { letter -&gt;<br />
reservedCaracters[(int)letter] ? &#8220;%&#8221; +Integer.toHexString((int)letter).toString().toUpperCase() : letter<br />
}<br />
return encoded.join(&#8220;&#8221;)<br />
}</strong></em></p>
<p>If you ever need something similar, use it <img src='http://blog.gigoo.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Greg</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.gigoo.org/2010/02/01/percent-encoding-in-groovy/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
