NodeJS, a small reptile, has a problem of garbled code.

  node.js, question

The code of the target site is GBK. When crawling with NodeJS, use


Is there any code disorder?

There is also cheerio that I used to parse HTML and then print:


After the Chinese became:


I’ve tried my best, but I can’t find a good solution. Perhaps my description is not accurate enough.

I suggest you read my article

99% can solve your problem