BluetoothSerial
BluetoothSerial copied to clipboard
链接打印机 打印中文乱码
@chenyongfei Happy new year, do u fix it now ? And can u tell me that how to print data from bluetooth pos printer?
bluetooth.write("新年快乐");
@chenyongfei bluetooth.write("新年快乐");
I don't know why , 現在還是乱码...
@chenyongfei https://github.com/don/BluetoothSerial#write
According to document:
String conversion assume 8bit characters.
You might need to convert from UTF-8 <-> ASCII.
有试过转换编码么? 按照说明文本, 写入的文字都会使用ASCII, 对UTF-8的文字可能无直接支援
function encode_utf8(s) {
return unescape(encodeURIComponent(s));
}
function decode_utf8(s) {
return decodeURIComponent(escape(s));
}