4

I need print non-english chars on print receipts, use thermal POS receipt printer. Xprinter XP-58III thermal POS receipt printer suppport generic ESC/POS commands. As I know this should be done by setting character code table. In my case, target code page is 21. The ESC/POS command for setting Code Page is 'ESC t n' (ASCII) or '1B 74 n' (Hex) where 'n' is page n of the character code table.

I case use of Hex form of command: shold I convert '21' to hex value, or I should use this number without converting, i.e. '1B 74 21'?

Also, where should be added thnis command, right after initialization code?

0x1B 0x40 0x1B 0x74 0x21

I use hex editor to add/edit ESC/POS codes inside the binary file.

EDIT: I solved the issue myself. In order to print any non-english characters on the POS receipt printer, we have to fulfill two conditions: 1) set the correct Code Page, and 2) set the corresponding encoding in receipt file or POS software (same encoding as Code Page). The correct Code Page for this POS printer model is 25 [WPC1257].

Lexx Luxx
  • 243
  • 1
  • 7
  • 13

2 Answers2

4

I solved the issue myself: the problem was in wrong Code Page set. The correct Code Page for this POS printer is 25 [WPC1257]. We have also set the corresponding encoding in receipt file (same encoding as Code Page).

Lexx Luxx
  • 243
  • 1
  • 7
  • 13
2

Page 21 would be "Thai Character Code 11", where 21 is represented in decimal and you need to say "0x15" in binary. Then the command will look like "0x1B 0x74 0x15".
Regarding the command position, the ESC/POS commands are executed in place and affects thereafter in general. There may be no problem it you put it just after the initialization command. Just try.

Trent
  • 4,208
  • 5
  • 24
  • 46
tshiono
  • 21,248
  • 2
  • 14
  • 22
  • In my case (XP-58III printer), the code page 21 is Latvian. '21' decimal is 0x15 hex, so I tried command `0x1B 0x74 0x15` after initialization, but it don't work. Why you specified `0x18` in place of `0x1B`? – Lexx Luxx Sep 19 '18 at 10:31
  • Sorry for my mistake: `0x18` is a typo and `0x1B` is correct for ESC. Still I don't get the reason why your command is not working even if you specify `0x15` as a character code. – tshiono Sep 19 '18 at 12:51