This is incorrect. It will double-encode certain values. For example, if the input is "http://swank.ca/cash%20money" this will yield "http://swank.ca/cash%2520money" which is a completely different URL.