const $ = require('cheerio');
$('<p>涓枃娴嬭瘯</p>').html()
Will get something like this: '中文测试', correct result should be '<p>涓枃娴嬭瘯</p>'.
@muyinliu doing it this way decodes the HTML entities into the actual characters:
const cheerio = require('cheerio');
const $ = cheerio.load('<p>涓枃娴嬭瘯</p>', {
decodeEntities: false
});
console.log($.html()); // <p>涓枃娴嬭瘯</p>
Thanks. It works fine now.
Most helpful comment
@muyinliu doing it this way decodes the HTML entities into the actual characters: