Providing the URL is correctly URL-encoded (ie. %-encoded) then the URL-decoded (ie. "normal" or %-decoded) URL is identical to the URL-encoded URL. If a bot did treat it differently then that is a fault of the bot.
The purpose of URL encoding is so it can be transmitted reliably (in US-ASCII).
If you don't explicitly encode the URL then the browser is most probably implicitly encoding this for you before making the request (although it won't necessarily get this right or as you intended, depending on the URL).
For example, given the URL in the question /product/piñata
. Even though this is not explicitly encoded, the browser implicitly encodes this as /product/pi%C3%B1ata
before making the HTTP request. If you right-mouse and "Copy Link Address" (Chrome) then it copies the %-encoded URL.
We want to start uri encoding using encodeURI()
our URLs during 301 redirect handling on our server.
(Presumably, you are using Node.js?)
Note that encodeURI()
is not the only tool (and not the only tool you may need) to correctly URL-encode the URL. If you are using a query string and using reserved characters in the parameter values then you will also need encodeURIComponent()
.