[Zope3-dev] Escape Character Summary Table

Guido van Rossum guido@python.org
Thu, 06 Jun 2002 13:24:09 -0400


> > > +        Listed as "safe" in RFC 1738; RFC 2396 "reserved in context"
> > 
> > This one looks the best to me now.
> 
> Beware though that '+' is the encoding of 'space' for CGI, and that
> some tools may encode/decode it incorrectly in the URL part.

Unless you have a specific example in mind, I think this is an
irrational fear.  '+' is translated back to space only query strings;
and nobody should encode '+' in a URL because it may already mean an
encoded space.

> I have this in a script that uses -remote:
>                 case "$url" in
>                     *,*) url=`echo "$url" | sed -e s/,/%2c/g` ;;
>                 esac
> and it works.

You can't fix all the tools already deployed in the world that don't
have this fix.

Why are people defending the comma so vigorously?  An URL with a comma
in it looks really ugly to me, because my brain unconsciously parses a
comma as a binary operator with a very low priority (lower than space,
in fact -- only '.' and ';' have lower priority).

--Guido van Rossum (home page: http://www.python.org/~guido/)