decodeURI function is a global function that decodes a string previously encoded using the
var decoded_uri = decodeURI(encoded_uri);
decodeURI() returns a decoded URI by replacing each UTF-8 escape sequence with the character that it represents.
decodeURI function can be used to decode special reserved characters and other non-ASCII characters such as letters with diacritics or from the Cyrillic alphabet.
Here's an example of decoding a URI that contains letters with diacritics:
The output of the above code will be:
Below is an example of decoding a URI that contains Cyrillic letters:
The above code will yield: