[racket-dev] URL escaping: question for web experts

From: Eli Barzilay (eli at barzilay.org)
Date: Mon Dec 17 09:59:17 EST 2012

For many people there is a constant source of annoyance when you
copy+paste doc URLs into a markdown context as with stackoverflow and
others.  The problem is that these URLs have parens in them and at
least in Chrome, the copied URL still has them -- and because markdown
texts use parens for URLs "[text](url)" they get confused which means
that you have to manually replace parens with %28 and %29.

Danny submitted a pull request that eventually got changed by Matthew
into a new parameter that controls which characters get encoded by
`net/uri-codec', so it can escape these too.  The result on Chrome is
that the copied URL has the escapes instead of parens, and clicking
such a URL makes the copy-able address have the escapes too.  The
actuall page that is displayed is still the same one, of course, it's
just weird that Chrome has a certain context where the original URL
string is preserved as is.  (It even considered the escaped URL as one
that I didn't visit, even though I visited the one with the unescaped
parens.)

In any case, given all of this I thought that maybe the default mode
could do the extra escaping -- it seems to me that there is no damage
with doing that, since in theory every character could be escaped
anyway.  There's a minor overhead of a few extra characters, but
there's the above benefit of doing it (which might be a temporary
thing for all I know).

Neither Matthew nor I feel confident enough to have this encoding be
the default without consulting some potential web standard gurus.

So?

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!

Posted on the dev mailing list.