S
S
sutkin main2017-01-24 07:00:38
JavaScript
sutkin main, 2017-01-24 07:00:38

Nodejs Why does it parse this ������ ������ b� 2006� test?

I'm doing a parser from a site, I can't understand why when parsing from one site they are displayed normally, but from another like this
������ ������ b� 2006� test?
and how to deal with it, I will wait for an answer, thanks in advance) I
forgot to write the encoding I use utf8 as expected

Answer the question

In order to leave comments, you need to log in

4 answer(s)
M
Michael, 2017-01-24
@kapko

In the article Web scraping with Node.js in the example, this problem is solved either by the iconv-lite package or by using needle instead of request

Y
Yuri, 2017-01-24
@kapitan7830

The encoding of the site that you are parsing and the file that displays this entry do not match

S
Sergey Suntsev, 2017-01-24
@GreyCrew

As an option, I can offer the following option.
You take a string from the site, check it for encoding, then, depending on the given encoding, you set the same one for yourself and completely parse the site.
Only it is necessary to get confused with the methods, something like, characterSet and actualEncoding used to work on firefox.

B
Bearax, 2017-01-24
@Bearax

Try setting UTF-8 encoding without BOM

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question