lsongdev / node-escpos

🖨️ ESC/POS Printer driver for Node.js
https://npmjs.org/escpos
Other
1.37k stars 422 forks source link

UTF8 problem #385

Open AzeDonLees opened 2 years ago

AzeDonLees commented 2 years ago

image hello everyone, I tried to print a smiley face and Russian letters, nothing comes out. Does anyone have ideas? i tried also 860, not have result. Code: 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(); });

AzeDonLees commented 2 years ago

and ə ö ğ ı ə ç ş ü not work too

Louis-jk commented 2 years ago

Would you like to try this?

const options = { encoding: "cp866" };

Cyrillic encoding code : cp866

zangab commented 2 months ago

There are different encodings possible like '860', see https://en.wikipedia.org/wiki/Code_page_860 just google for code page and check your needed set of characters