V
V
Vearodev2020-09-02 22:35:27
Angular
Vearodev, 2020-09-02 22:35:27

Nestjs/angular http module, XML encoding issue?

I get an XML string at a certain URL, a string with a problematic encoding of Russian characters arrives. By directly opening XML in a browser with encoding, everything is fine, what am I doing wrong?

return this.http.get(url, {
   responseType: 'text',
})

Something like this comes

<description>Led ����� ���������� E27 6W (2700K)</description>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
acwartz, 2020-09-16
@acwartz

Request the encoding and content type from the server via headers.
content-type: yyy; charset=utf-8;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question