buf2str(buffer) { let encodedString = String.fromCodePoint.apply(null, new Uint8Array(buffer)); let decodedString = decodeURIComponent(escape(encodedString));//没有这一步中文会乱码 console.log(decodedString); return decodedString },
时间紧迫,请看代码。亲测有效