Open tchala120 opened 3 years ago
I have tried UTF-8 to print the Thai characters but I got Chinese characters instead.
This is my code
const escpos = require("escpos"); escpos.USB = require("escpos-usb"); const device = new escpos.USB(); const options = { encoding: "UTF8" }; const printer = new escpos.Printer(device, options); device.open(function (error) { printer .size(0, 0) .font("a") .align("ct") .style("b") .text("สวัสดี") .cut() .close(); });
This is the result
Expected result
Should print สวัสดี in the paper
สวัสดี
How to fix it?
try this instead const options = { encoding: '860' };
const options = { encoding: '860' };
can't work
Guess you need to use 874, see https://de.wikipedia.org/wiki/Codepage_874
874
I have tried UTF-8 to print the Thai characters but I got Chinese characters instead.
This is my code
This is the result
Expected result
Should print
สวัสดี
in the paperHow to fix it?