var req = http.get(url,function(res){ res.setEncoding('utf-8'); var html = '' res.on('data',function(data){ html+=data.toString(); }).on('end',function(){ console.log(html); }) });…
用c#读取文件内容中文是乱码的解决方法: //方法1: StreamReader din = new StreamReader(@"C:\1.txt", System.Text.Encoding.GetEncoding("gb2312")); string html = ""; while (din.Peek() > -1) { html = html + din.ReadToEnd(); } din.Close(); //方法2: Str…