I've just noticed that URLEscape in the http package doesn't escape
"$" properly, it should be encoded as "%24", is this normal?
Now I'm using this expression to overcome the problem:
strings.Replace(http.URLEscape(string), "$", "%24", -1)
Thanks, Roger.
Every time I read RFC 2396 I see that it is even more
complex than the last time I read it. Trying to puzzle out
the rules for $, I can't tell whether it's okay in query sections
(the text says no, the grammar says yes, the grammar
also allows separators like & and ?, the text explains those,
but the text never explains the meaning of $).
I suppose we could just escape every byte, but that turns
out to cause problems with other (non-conforming) server,
not to mention making things unreadable.
Can you tell me what the meaning of $ is and why it
should be escaped?
Russ
Everything is described in this document:
http://bittorrent.org/beps/bep_0003.html
It just says infohash has to be url escaped, it doesn't specify
anything regarding "$", but it won't work if you don't replace it with
"%24". Anyway it took me a long time to realize the problem, since I
assumed URL encoding was something more standard.
2010/9/3 Russ Cox <r...@golang.org>:
It's described by a standard, but the standard is not terribly clear.
Every different piece of a URL has a slightly different set of
characters that must be escaped, and there's no nice list saying
"here they are". I've created
http://code.google.com/p/go/issues/detail?id=1076
so that we remember to take another stab at this.
Russ
2010/9/3 Russ Cox <r...@golang.org>: