If you are finding a way to encode urls in ruby then here is a quick tip -
Short Answer: You could use the URI class or the CGI class.
We have CGI.escape and URI.escape, but they have some slight differences. I have tried to show the differences in IRB as follows -
irb(main):001:0> str = 'hello world'
=> "hello world"
irb(main):002:0> require 'uri'
irb(main):004:0> require 'cgi'
irb(main):006:0> url = 'http://example.com/åäö'
So i hope you can see the difference now and can choose the one you need.