Skip to content

Commit 468fd7a

Browse files
committed
设定/取消汉字模式
1 parent cb538cb commit 468fd7a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/commander.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,11 @@ class Commander {
107107
switch (type) {
108108
case 'esc':
109109
adapter = (this.isSunmi ? new EscSunmi.Printer(null, { width }) : new Escpos.Printer(null, { width }))
110+
if (!this.encoding || /GBK|BIG5/i.test(this.encoding)) {
111+
adapter.buffer.write([0x1C,0x26])
112+
} else {
113+
adapter.buffer.write([0x1C,0x2E])
114+
}
110115
break
111116
case 'tsc':
112117
adapter = new Tsc({ width, height, wordWidth, direction, margin, space })

0 commit comments

Comments
 (0)