[armedbear-devel] Further inconsistencies in ABCL uri escaping rules
Mark Evenson
evenson at panix.com
Wed Jun 22 09:58:00 UTC 2011
On 6/21/11 12:27 , Mark Evenson wrote:
> The rules adopted for URI encoding are
>
> 1. All pathname components are represented "as is" without escaping.
>
> 2. Namestrings are suitably escaped if the Pathname is a URL-PATHNAME
>
> or a JAR-PATHNAME.
[…]
Alan asked me to include some docstrings for this behavior, so in
writing them up I discovered two points that need clarification.
a) For URL-PATHNAME the directory components are stored with the URI
escaping, contradicting the first rule
(pathname-directory #p"http://example.org/bar%20with%20space/there")
==> (:ABSOLUTE "bar%20with%20space")
b) For a JAR-PATHNAME the DIRECTORY-NAMESTRING returns an unescaped string:
(directory-namestring #p"jar:file:foo.jar!/a%20spaced%20directory/bar.lisp")
==> "/a spaced directory/"
It might be nice to allow behavior a) to stand with the reasoning that
the typical usage might be to splice up URI paths but in the end the
result would be reconstituted as a URL-PATHNAME, but this contradicts
the simplicity of rule #1.
But I think behavior b) should be fixed to emit the uri encoded
representation. If the user wishes to take components from a
URL-PATHNAME to refer to files on the local filesystem with #\Space
instead of %20, she would need to explicitly specify such a transformation.
Thoughts? I hope this isn't the tip of another iceberg…
--
"A screaming comes across the sky. It has happened before, but there
is nothing to compare to it now."
More information about the armedbear-devel
mailing list