[Yum-devel] [UG] url encoding advice
Michael Stenner
mstenner at linux.duke.edu
Tue Dec 20 22:47:17 UTC 2005
OK, someone just filed a bug against urlgrabber that brings up an
interesting issue: pre-encoded urls.
http://devel.linux.duke.edu/bugzilla/show_bug.cgi?id=539
The summary: if you give urlgrabber an encoded url, it re-encodes it.
For example:
a) (raw url) http://place.com/foo bar
b) (encoded) http://place.com/foo%20bar
c) (re-encoded) http://place.com/foo%2520bar
urlgrabber gets (b), see's the "%" and encodes that as %25. It seems
other tools will be clever and try to detect whether something needs
to be reencoded. What's the best way to do that?
1) be a hard-ass and say "urlgrabber expects unencoded urls"
2) provide an option that says whether or not the url is encoded
(ugly and impractical)
3) try and be clever - for example, encode " " but not "%" (broken
behavior in the strictest sense)
4) allow for an "encoder object" that can be used to implement the
desired encoding policy, perhaps with the default behavior being
(3)
Number (4) is the most work, but is probably the best way to go.
Thoughts?
-Michael
--
Michael D. Stenner mstenner at ece.arizona.edu
ECE Department and Optical Sciences Center 520-626-1619
University of Arizona ECE 524G
More information about the Yum-devel
mailing list