I’m trying to figure out a difference between a URI.escape and URI.encode in Ruby.
Neither is doing what I want them to, which is to completely encode an URL.
For example I want http://my.web.com to be http%3A%2F%2Fmy%2Eweb%2Ecom
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There is no difference. In Ruby 1.9.3
encodeis simply an alias forescape.[Edit] Note that those methods allow an “unsafe” descriptor of characters to encode:
Thanks @muistooshort! =)