var decoded_uri_comp = decodeURIComponent(encoded_uri_comp);
decodeURIComponent returns a decoded URI component by replacing each UTF-8 escape sequence with the character that it represents.
Here's an example of decoding a URI component that contains letters with diacritics:
The above code will output:
Below is an example of decoding a URI that contains Cyrillic letters:
The output of the above code will be: