Changes bad URI component encoding. Changed from escape to encodeURIComponent