Issue #4167 has been updated by Yui NARUSE.


URI lib says it refers RFC2396, so current behavior is correct in its spec.

Yes, I know current behavior is not what you expect.
So we plan to change the lib to refer RFC3986.

Moreover current URI.encode is simple gsub.
But I think it should split a URI to components, then escape each components,
and finally join them.

So current URI.encode is considered harmful and deprecated.
This will be removed or change behavior drastically.

> What is the replacement at this time?

As I said above, current URI.encode is wrong on spec level.
So we won't provide the exact replacement.
The replacement will vary by its use case.

We thought most use case is to generate escaped URI from joined URI componets.
For this, people should use URI.join or URI.encode_www_form;
you should escape each components before join them.
----------------------------------------
http://redmine.ruby-lang.org/issues/show/4167

----------------------------------------
http://redmine.ruby-lang.org