Hello,

I'm getting an URI::InvalidURIError in my controller when I use german
characters in the uri. Google accepts them but open-uri not. How to
encode them?

That's my controller simplified:

def index
  require 'open-uri'
  address = "Bürgerstraße+68+01127+Dresden"
  api_key = "my api key"
  json = open("http://maps.google.com/maps/geo?q=#{(address)}
&output=json&key=#{api_key}").read
  render :text => json
end

My environment:
Rails 2.3.2
Gem 1.3.4
ruby 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0]

Yours, Matthias.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to