What’s the difference between URI.escape and CGI.escape and which one should I use?
What’s the difference between URI.escape and CGI.escape and which one should I use?
Share
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 were some small differences, but the important point is that
URI.escapehas been deprecated in Ruby 1.9.2… so useCGI::escapeor ERB::Util.url_encode.There is a long discussion on ruby-core for those interested which also mentions WEBrick::HTTPUtils.escape and WEBrick::HTTPUtils.escape_form.