this.data.socket = wx.createUDPSocket()
this.data.socket.onMessage(function(res){
console.log(res)
var unit8Array = new Uint8Array(res['message'])
let encodeString = String.fromCharCode.apply(null, unit8Array)
encodeString = encodeString.replace(/%/g,'%25')
var data = decodeURIComponent(escape(encodeString))
console.log('接收到:',data)
})
同问,怎么解决这个问题
如果不加decodeURIComponent 就乱码 加了报错URI malformed URIError: URI malformed 有大佬知道怎么解决吗