text-encoding正确使用姿势

蓝牙打印,需要转字符串为gb2312到uint8array.果断使用了一把text-encoding,始终不对。

https://github.com/inexorabletash/text-encoding

搞了2-3个小时,为毛不能进入函数调用里面,文档里面说是polliy.js,要提前把TextEncoder干掉,突然想起来了chrome可能有TextEncoder对象。果断提前干掉它。一切都正常了。特此记录。

原文地址:https://www.cnblogs.com/forhell/p/9213641.html