Open LveUp opened 5 years ago
response.on('end', function () { //新的解析方式 const StringDecoder = require('string_decoder').StringDecoder; const decoder = new StringDecoder('utf8'); let newResult = ''; for (let i = 0; i < body.length; i++) { let str = decoder.write(body[i]); newResult += str } console.log('============new result==========', newResult); //旧的解析方式 var result = body.join(''); // Parsing JSON if (result[0] === '[' || result[0] === '{') { try { console.log('============result==========', result); result = JSON.parse(result); } catch (e) { // nothing to do } }
//newResult: ... "name": "问题类型", ...
//result: ... "name": "��题类型", ...
Hi, @LveUp! I need help from more experienced members, @floralvikings what do you think about this?
It looks like it's related to #80
//newResult: ... "name": "问题类型", ...
//result: ... "name": "��题类型", ...