How to convert %D0%9F%D1%80%D0%B8%D0%B2%D0%B5%D1%82 to Unicode in JS

207 Views Asked by At

The main core of question is — I did not know what's the name of this type of string. I am getting output function strings in this format %D0%9F%D1%80%D0%B8%D0%B2%D0%B5%D1%82. I don't know what type of code is this. Tell me please how to convert it to Unicode in JavaScript. Actually this string is "Привет". Thank you.

1

There are 1 best solutions below

1
On BEST ANSWER

Using decodeURIComponent()

The decodeURIComponent() function decodes a Uniform Resource Identifier (URI) component previously created by encodeURIComponent or by a similar routine.

var decodedStr = decodeURIComponent('%D0%9F%D1%80%D0%B8%D0%B2%D0%B5%D1%82')
console.log(decodedStr);