是否可能在非UTF8编码下阅读网页?例如windows-1251。 我尝试使用node-iconv转换结果:
var convertedBody = new Iconv('windows-1251','utf-8').convert(responseBody));
但我收到了异常:
Error: EILSEQ, Illegal character sequence.
at IncomingMessage.<anonymous> (/root/nodejstest/test2.js:22:19)
at IncomingMessage.emit (events.js:59:20)
at HTTPParser.onMessageComplete (http.js:111:23)
at Socket.ondata (http.js:1183:22)
at Socket._onReadable (net.js:654:27)
at IOWatcher.onReadable [as callback] (net.js:156:10)
谢谢!