Change window.escape with encodeURIComponent

Some chars like 'º' don't escape well with function window.escape, is better use encodeURIComponent to prevent errors on decode.