miniprogram-bluetoothprinter icon indicating copy to clipboard operation
miniprogram-bluetoothprinter copied to clipboard

中文字符判断问题

Open feihongxiansen opened this issue 5 years ago • 0 comments

printerUtil.js中的中文字符判断方法有点问题,全角字符判断不了,全角字符应该是2个宽度,但是原来的方法判断为1个宽度,将正则表达式加上全角字符的编码即可,修改后代码为 function isChinese(str) { return /^[\u4e00-\u9fa5]|[\uff00-\uffff]$/.test(str); }

feihongxiansen avatar Sep 18 '19 15:09 feihongxiansen