开发者

What is the Ruby/Rails equivalent of Python's urllib.quote_plus?

开发者 https://www.devze.com 2022-12-25 09:35 出处:网络
Basically url escapes a string e开发者_StackOverflow中文版xcept uses \'+\' instead of \'%20\' for spaces.CGI::escape does just that:

Basically url escapes a string e开发者_StackOverflow中文版xcept uses '+' instead of '%20' for spaces.


CGI::escape does just that:

irb(main):003:0> require 'cgi'
=> true
irb(main):004:0> CGI::escape("foo and/or bar")
=> "foo+and%2For+bar"
0

精彩评论

暂无评论...
验证码 换一张
取 消