<?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: ruby google charts api wrapper, RFC2396 and ruby open-uri woes</title>
	<atom:link href="http://www.sofasportler.de/dirk.blog/articles/ruby-google-charts-api-wrapper-rfc2396-and-ruby-open-uri-woes/feed" rel="self" type="application/rss+xml" />
	<link>http://www.sofasportler.de/dirk.blog/articles/ruby-google-charts-api-wrapper-rfc2396-and-ruby-open-uri-woes</link>
	<description>on me and coding and some things</description>
	<lastBuildDate>Mon, 07 Mar 2011 23:56:27 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: about: things &#187; Blog Archive &#187; googlecharts gem URI::InvalidURIError fixed</title>
		<link>http://www.sofasportler.de/dirk.blog/articles/ruby-google-charts-api-wrapper-rfc2396-and-ruby-open-uri-woes/comment-page-1#comment-43798</link>
		<dc:creator>about: things &#187; Blog Archive &#187; googlecharts gem URI::InvalidURIError fixed</dc:creator>
		<pubDate>Sat, 12 Jan 2008 13:03:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.sofasportler.de/dirk.blog/articles/ruby-google-charts-api-wrapper-rfc2396-#comment-43798</guid>
		<description>&lt;p&gt;[...] Yesterday i was wondering who is right about the URI and as it turns out the culprit is the googlecharts gem. The RFC defines &#8216;UNWISE&#8217; characters, the ruby URI implementation seem to correctly fail on them and the Google API defines the just the URI, not how it has to be encoded/escaped.I posted the scary URI regex from the ruby open-uri package which fails to grasp the Google Charts URIs. Debugging such thing is no fun so i went for a quick fix instead and actually could find it in the googlecharts gem. Just replace:jstize(@@url + query_params.join(&#039;&amp;&#039;)) from ...ruby/gems/1.8/gems/googlecharts-0.2.0/lib/gchart.rb with:unwise = []#%w({ } &#124;  ^ [ ] )&lt;br /&gt;query_params.each do &#124;p&#124;&lt;br /&gt; unwise.each { &#124;c&#124; p.gsub!(c, &quot;%#{c[0].to_s(16).upcase}&quot;) }&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;jstize(@@url + query_params.join(&#039;&amp;&#039;))&lt;/code&gt;&lt;/pre&gt;this escapes the &#039;&#124;&#039; (pipe) characters which were causing the exception, like this one:&lt;br /&gt;&lt;code&gt;/opt/local/lib/ruby/1.8/uri/common.rb:436:insplit&#8217;: bad URI(is not URI?): http://chart.apis.google.com/chart?chdl=requests(cached)&#124;requests&amp;chd=s:Fb9JJfgZ,Fb9KJfgq&amp;cht=lc&amp;chs=300&#215;200 (URI::InvalidURIError)Technorati Tags: ruby, googlecharts, google, gem, fix [...]&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>[...] Yesterday i was wondering who is right about the URI and as it turns out the culprit is the googlecharts gem. The RFC defines &#8216;UNWISE&#8217; characters, the ruby URI implementation seem to correctly fail on them and the Google API defines the just the URI, not how it has to be encoded/escaped.I posted the scary URI regex from the ruby open-uri package which fails to grasp the Google Charts URIs. Debugging such thing is no fun so i went for a quick fix instead and actually could find it in the googlecharts gem. Just replace:jstize(@@url + query_params.join(&#8216;&amp;&#8217;)) from &#8230;ruby/gems/1.8/gems/googlecharts-0.2.0/lib/gchart.rb with:unwise = []#%w({ } |  ^ [ ] )&lt;br /&gt;query_params.each do |p|&lt;br /&gt; unwise.each { |c| p.gsub!(c, &#8220;%#{c[0].to_s(16).upcase}&#8221;) }&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;jstize(@@url + query_params.join(&#8216;&amp;amp;&#8217;))&lt;/code&gt;&lt;/pre&gt;this escapes the &#8216;|&#8217; (pipe) characters which were causing the exception, like this one:&lt;br /&gt;&lt;code&gt;/opt/local/lib/ruby/1.8/uri/common.rb:436:insplit&#8217;: bad URI(is not URI?): <a href="http://chart.apis.google.com/chart?chdl=requests(cached)" rel="nofollow">http://chart.apis.google.com/chart?chdl=requests(cached)</a>|requests&amp;chd=s:Fb9JJfgZ,Fb9KJfgq&amp;cht=lc&amp;chs=300&#215;200 (URI::InvalidURIError)Technorati Tags: ruby, googlecharts, google, gem, fix [...]</p>]]></content:encoded>
	</item>
	<item>
		<title>By: rubylicio.us</title>
		<link>http://www.sofasportler.de/dirk.blog/articles/ruby-google-charts-api-wrapper-rfc2396-and-ruby-open-uri-woes/comment-page-1#comment-43618</link>
		<dc:creator>rubylicio.us</dc:creator>
		<pubDate>Fri, 11 Jan 2008 18:42:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.sofasportler.de/dirk.blog/articles/ruby-google-charts-api-wrapper-rfc2396-#comment-43618</guid>
		<description>&lt;p&gt;You&#039;re not alone with this problem ... everytime I write a webbot I encounter this problem way too many times. That regexp looks scary to start poking around in though ;)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>You&#8217;re not alone with this problem &#8230; everytime I write a webbot I encounter this problem way too many times. That regexp looks scary to start poking around in though ;)</p>]]></content:encoded>
	</item>
</channel>
</rss>

