I run a scrape site using nodejs to get the articles, I want to load Chinese website using XMLHttpRequest and the site is using this meta
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
and my site used charset UTF-8
xhr = new XMLHttpRequest();
xhr.open("GET", url, true);
xhr.setRequestHeader('Content-Type','text/html; charset=gbk');
xhr.onreadystatechange = function () {
//DOM Processing
$=cheerio.load(xhr.responseText);
};
xhr.send();
does anyone know what i have to set for the header ? I tried charset gbk / GB2312 also didn't work. Any help will be great. Thanks