URI.escape 和 CGI​​.escape 有什么区别? [英] What's the difference between URI.escape and CGI.escape?

查看:42
本文介绍了URI.escape 和 CGI​​.escape 有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

URI.escapeCGI.escape 有什么区别,我应该使用哪个?

What's the difference between URI.escape and CGI.escape and which one should I use?

推荐答案

有一些小的差异,但重要的一点是 URI.escape 已经已弃用 在 Ruby 1.9.2 中...所以使用 CGI::escapeERB::Util.url_encode.

There were some small differences, but the important point is that URI.escape has been deprecated in Ruby 1.9.2... so use CGI::escape or ERB::Util.url_encode.

有很长的讨论 on ruby​​-core 对于那些也提到 WEBrick::HTTPUtils.escapeWEBrick::HTTPUtils.escape_form.

There is a long discussion on ruby-core for those interested which also mentions WEBrick::HTTPUtils.escape and WEBrick::HTTPUtils.escape_form.

这篇关于URI.escape 和 CGI​​.escape 有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆