简体   繁体   English

带有 ESCPOS 库的土耳其字符不起作用

[英]Turkish char with ESCPOS library don't work

I try to use this library : https://github.com/song940/node-escpos for print text with AURES ODP444我尝试使用这个库: https : //github.com/song940/node-escpos用 AURES ODP444 打印文本

That's work fine but when i try to print turkish char like below i have wrong character on the paper ..这很好用,但是当我尝试像下面这样打印土耳其字符时,我在纸上有错误的字符..

Ç Ğ I İ Ö Ş Ü ü ş ö i ı ğ ç Â â î Î Û û Ç Ğ I İ Ö Ş Ü ü ş ö i ğ ç Â â î Î Û û

I try to encode with latin5 / ISO-8859-9 but don't work too ..我尝试使用 latin5 / ISO-8859-9 进行编码,但也不起作用..

const escpos = require('escpos')
escpos.SerialPort = require('escpos-serialport')
const options = { encoding: "iso-8859-9" }
const device = new escpos.SerialPort('COM4')
const printer = new escpos.Printer(device, options)

device.open((error) => {
printer.font('a')
.size(0.75,0.75)
.text("Marvın")
.feed()
.close()
})

The result of this is Marv²n这样做的结果是Marv²n

Someone can help me please ?有人可以帮我吗? Thank you.谢谢你。

For someone who want the answer (for ODP333/ODP444)对于想要答案的人(对于 ODP333/ODP444)

If you want change encodage, download utility software from support website, connect to your printer and change code page (For turkish it's cp857) and don't forget in your code to encode in cp857.如果您想更改编码,请从支持网站下载实用程序软件,连接到您的打印机并更改代码页(土耳其语为 cp857)并且不要忘记在您的代码中使用 cp857 进行编码。

const options = { encoding: "cp857" }

http://aures-support.com/DATA/Doc/PRINTER/CONFIGURATION-MANUALTHERMAL-PRINTER_AURES.pdf http://aures-support.com/DATA/Doc/PRINTER/CONFIGURATION-MANUALTHERMAL-PRINTER_AURES.pdf

Thanks all for your help !感谢你的帮助 !

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM