-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement CGI.escapeURIComponent
and CGI.unescapeURIComponent
#26
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(My comments were about... comments.)
2b9e3ba
to
5280728
Compare
Thanks @olleolleolle |
5280728
to
652fadb
Compare
CGI.url_encode
and CGI.url_decode
CGI. escapeURIComponent
and CGI.unescapeURIComponent
652fadb
to
dbdf846
Compare
CGI. escapeURIComponent
and CGI.unescapeURIComponent
CGI.escapeURIComponent
and CGI.unescapeURIComponent
I updated the PR to match what was accepted at the last meeting. |
I'm curious what was the justification for the non-standard camel case names? To match the standards? |
|
Is it good justification? Why not add alias |
dbdf846
to
926cdfd
Compare
926cdfd
to
deb2873
Compare
[Feature #18822] Ruby is somewhat missing an RFC 3986 compliant escape method.
deb2873
to
c2729c7
Compare
Ref: ruby/cgi#26 This native implementation is much faster and available in `cgi 0.3.3`.
Ref: ruby/cgi#26 This native implementation is much faster and available in `cgi 0.3.3`.
Ref: ruby/cgi#26 This native implementation is much faster and available in `cgi 0.3.3`.
(ruby/erb#23) Ref: ruby/cgi#26 This native implementation is much faster and available in `cgi 0.3.3`. ruby/erb@2d90e9b010
(ruby/erb#23) Ref: ruby/cgi#26 This native implementation is much faster and available in `cgi 0.3.3`. ruby/erb@2d90e9b010
Thank you, this is very helpful!
I am curious to learn more about how the escape differs from Javascript |
From MDN:
Whereas
So it's a bit more strict even. |
Thank you! Any clues as to motivation? The ruby choice to escape seems right to me, I wouldn't want I guess this also just shows how many people have had such trouble getting this right and consistent over time. |
Ruby follow a fairly recent RFC https://www.rfc-editor.org/rfc/rfc3986#section-2.3, and allow you to escape for pretty much all parts of the URL (path, query, anchor, etc). The behavior of JS |
Ref: https://bugs.ruby-lang.org/issues/18822
Ruby is somewhat missing an RFC 3986 compliant escape method.