Answer the question
In order to leave comments, you need to log in
fetch(). Answer with Unicode Character. How to "decode"?
Hello.
I make a request to a server (not mine) using fetch().
This is how I get the answer:
await response.text();
The answer contains: blotches jQuery + html layout + useful information about the movie. In the response (Latin and Cyrillic, which is represented by Unicode Character. A small piece \u0417\u0430\u043a\u0440\u044b\u0442\u044c) I
assign the response to a variable to parse the information using jQuery, and here the problems begin, because js does not perceive characters \uXXX.
tried
decodeURIComponent(await response.text());
JSON.parse(await response.text());
Answer the question
In order to leave comments, you need to log in
Look in what encoding the server gives you a response, to do this, open the browser console, go to the Network tab and take a screenshot of the received headers, then upload it here.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question