小程序ArrayBuffer转JSON
1 let arrayBuffer = fsm.readFileSync(res.tempFilePath) 2 let unit8Arr = new Uint8Array(arrayBuffer) 3 let encodedString = String.fromCharCode.apply(null, unit8Arr) 4 let decodedString = decodeURIComponent(escape(encodedString)) 5 console.log(JSON.parse(decodedString))
1 let arrayBuffer = fsm.readFileSync(tempFilePath,"utf-8") 2 console.log(JSON.parse(arrayBuffer))