扫码遇到`80`后整个结果带字母的都变成`fffd`,
https://developers.weixin.qq.com/miniprogram/dev/api/device/scan/wx.scanCode.html [图片],例如这个二维码,扫出来结果(res.result)转为16进制应该是 2,7,ba,6,40,1,5,f8,5,f2,ff,ff,ff,80,39,4, 实际却是 2,7,fffd,6,40,1,5,fffd,5,fffd,fffd,fffd,fffd,fffd,4,1,fffd, 所有带字母的都变成了fffd(且字符变相同了),但用base64解码(res.rawData)还能解出正确值。 下为string到十六进制代码 function string2hex(str) {
var result = '';
for (var i=0; i<str.length; i++) {
result += str.charCodeAt(i).toString(16);
result+=','
}
return result
}