Worth knowing
A whole URL and one query value are not the same job.
Encoding a query value should escape characters such as spaces and ampersands. Encoding a whole URL should leave separators such as : / ? and & in place so the URL structure still works.