From: "shyouhei (Shyouhei Urabe)" Date: 2012-07-04T20:53:13+09:00 Subject: [ruby-core:46177] [ruby-trunk - Bug #6696][Feedback] [PATCH] ERB::Util.url_encode should not escape unreserved characters Issue #6696 has been updated by shyouhei (Shyouhei Urabe). Subject changed from [PATCH] to [PATCH] ERB::Util.url_encode should not escape unreserved characters Status changed from Open to Feedback FYI, the old discussion is at https://github.com/ruby/ruby/pull/54 I see the patch itself is OK. The question is to be or not to be able to escape tilde. ---------------------------------------- Bug #6696: [PATCH] ERB::Util.url_encode should not escape unreserved characters https://bugs.ruby-lang.org/issues/6696#change-27799 Author: madeofcode (Mark Dodwell) Status: Feedback Priority: Normal Assignee: Category: Target version: 1.9.3 ruby -v: ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.4.2] ERB::Util.url_encode is escaping tilde (~) where it should not according to the RFC. This fixes that behaviour so that it now correctly avoids escaping all unreserved characters as per RFC 3986, Section 2.3: http://tools.ietf.org/html/rfc3986#section-2.3 Fwiw., this is also how the Perl implementation works: http://search.cpan.org/dist/URI/URI/Escape.pm#DESCRIPTION I opened this issue originally on Github, but I think it warrants further discussion, so re-opening here. -- http://bugs.ruby-lang.org/