From: "NARUSE, Yui" Date: 2010-04-09T16:08:51+09:00 Subject: [ruby-core:29379] Re: URI.(un)escape deprecated? 2010/4/9 Austin Ziegler : > On Thu, Apr 8, 2010 at 10:31 PM, Tanaka Akira wrote: >>> * URI.www_form_encode_component >> It should be URI.encode_www_form_component. > > That's a little long, IMO, but your test results indicate that it is > the right choice. How new is this method? Yeah, but there is some escape encodings for URI and its parts. So explicit name is needed in the URI context. As akr showed in [ruby-core:29373], following are for the same use case: escaping the data of web forms for a query. * CGI.escape(s) * URI.encode_www_form_component(s) * WEBrick::HTTPUtils.escape_form(s) They are different in some portions but significant difference is escaping " " to "+". * CGI.escape escapes many symbols * WEBrick::HTTPUtils.escape_form keep symbols * URI.encode_www_form_component follows HTML5's description > I'd much rather see URI.escape/URI.unescape be replaced with methods > that work, backwards compatibility with broken behaviour be damned. We don't have any consensus about what behavior is correct for the name URI.escape. -- NARUSE, Yui naruse@airemix.jp