Re: URI and IRI Templating - encoding defaults

On Tue, 2007-01-16 at 14:17 +1100, Mark Nottingham wrote:
> Proposal: only escape things outside of ( iprivate / iunreserved /  
> ireserved ) -- i.e., characters not allowed in URIs. It's up to the  
> definitions of specific template variables to determine how to  
> percent-encode beyond that.

I concur, and add a few extra reasons:

1. Sometimes it may be useful to substitute a whole query part, or whole
sigificant segment of a url. Eg, http://example.com{pathToResource}
2. Sometimes it may be even useful to substitute the whole url:
{mailToSelection}

This actually suggests to me that perhaps no blanket rule should be
included in the specification. It is simply the responsibility of the
supporting instructions to construct a valid URL. Encoding ( iprivate /
iunreserved / ireserved) into the specification ties uri templates to
the current uri rfc, creating unnecessary coupling.

Even restricting resultant urls to be valid may be overreaching. After
all, should a browser decide the url isn't valid and stop the
submission? Shouldn't it just pass the information it doesn't understand
through and let the server side decide what is valid and what is not? I
would be as circumspect as possible in the specification as to what
constitutes valid output.

Benjamin.

Received on Sunday, 21 January 2007 04:08:46 UTC