Carl_F
Carl_F

Reputation: 1

Android ESC/POS protocol printing in Cyrillic

I bought a no-name Android ESC/POS printer, it support Bluetooth. I need help in printing Cyrillic symbols in Windows-1251 charset. What I do first:

\x1B\x40 (ESC @ to initialize printer)

\xD5\xD3\xC9\n (the text that I need to print, standard Windows-1251 symbols, but it shows me some abracadabra :))

I should say, that the charset is set to Windows-1251 on the printer (by the exe tool that comes with it)

Also I tried command \x1B\x74\x49 (it sets the Windows-1251 manually, but there is no effect). Any ideas what we can do with it? Thank you all.

Upvotes: 0

Views: 4036

Answers (4)

Yeldar Nurpeissov
Yeldar Nurpeissov

Reputation: 2296

With Universal Cyriclic decoder you can find your source encoding/decoding.

Enter in decoded field your output text. For example 袩褉懈胁械褌. Select source encoding UTF-8. Then find your wanted decoding charset by selecting field "display as".

Upvotes: 0

Sough
Sough

Reputation: 363

I tried many variants and after this manual end up with this character code page settings { 27, 116, 9 }

outputStream.write(new byte [] { 27, 116, 9 }); outputStream.write("Привет Мир".getBytes("cp866")); outputStream.write(PrinterCommands.LF);

Upvotes: 2

Alexander Danilov
Alexander Danilov

Reputation: 31

Try to convert your text to cp866.

And set code page in printer via ESC/POS command into 17.

Upvotes: 1

diegoveloper
diegoveloper

Reputation: 103451

You can try my app that print cyrillic text: https://play.google.com/store/apps/details?id=pe.diegoveloper.printerserverapp

Configure your ESC/POS printers on 'Quick Printer' and print from your app.

Upvotes: 2

Related Questions