var request = require(“request”); var iconv = require(“iconv-lite”);
request.get("http://www.163.com",function(err,response,result){ var html = iconv.decode(new Buffer(result), ‘win1251’) //var html = iconv.decode(new Buffer(result), ‘gbk’) console.log(html) });
代码就是上面的
怎么都是乱码,不知道为什么??