this is copy pasted from sdelib's method ... it is a quick shortcut to do a proper url encoding of a string (urllib's urlencode just encodes dictionaries).

Some protocols expect a certain string or parameter to be urlencoded somewhere ...