We're using decodeURIComponent to match any encoded value that might be sent/encoded by the browser. An example of this is a smart quote ’ -- That value is going to be encoded to %E2%80%99. We store the actual symbol in our database, not the encoded value, so, when decoding it, we need to ensure we can get the direct symbol and, in consequence, the page we're looking for.
We're using
decodeURIComponent
to match any encoded value that might be sent/encoded by the browser. An example of this is a smart quote ’ -- That value is going to be encoded to%E2%80%99
. We store the actual symbol in our database, not the encoded value, so, when decoding it, we need to ensure we can get the direct symbol and, in consequence, the page we're looking for.