Cheerio: why words become to &#x...?

Created on 30 Dec 2014  路  4Comments  路  Source: cheeriojs/cheerio

some utf8 gbk words in html will be like below:

注意事项:本产品设计有增压原理,若用完后还有部分水流出那是正常现象。这种情况是龙头关闭后花洒内部还有残留的水流出,这种增压设计就是这样的情况!只有挑刺买家才会计较这算不上问题的事拿来说之后想

how to encde back to utf8?

Most helpful comment

decodeEntities: false

resove the problerm!

All 4 comments

I bet you can encode back by using third party library. Or you can try to disable "decodeEntities". Check the Parser options

var $=_cheerio.load(ondesc, {
            normalizeWhitespace: false,
            xmlMode: false,
            decodeEntities: true
        });

still output

注意事

decodeEntities: false

resove the problerm!

Worked for me, too. Problem is that htmlparser2 page says the default is false already but when i set it to false it worked.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kminehart picture kminehart  路  5Comments

dandv picture dandv  路  5Comments

tndev picture tndev  路  4Comments

rajkumarpb picture rajkumarpb  路  3Comments

trevorfrese picture trevorfrese  路  4Comments