escape pipe characters in urls

Ruby would give the error `URI::InvalidURIError: bad URI(is not URI?)` when trying to open() or parse the url with pipes that weren't encoded.