0

More specifically, what is the difference between ESC t and ESC R and when should i use them?

How does it tie with the character encoding of the byte arrays i may send to the printer?

Edit

As a follow-up,

  • the text to be printed is coming as ISO-8859-1 from the software and includes typical "Latin 1" Portuguese characters such as á é ã ç and
  • i'm setting ESC t to WPC1252 (0x10) and have also tried PC860 (0x03) to no avail
  • there is no ESC R that corresponds to Portuguese, so i tried
    • noy providing ESC R
    • using Spain I and II (0x07 and 0x0B respectively)

unsuccessfully.

I'm testing with multiple devices and the non-ASCII characters are always printed as "garbage".

A cheap Bluetooth printer prints Kanji characters, the test page shows "Codepage: GBK" but I can't find it in the reference; nor can i find "ANK" which is also referenced.

An Android device with built-in Bluetooth printer prints Greek characters and the test page says "Chinese mode: no" as well as
"Resident character:
Alphanumeric
GB1312<more kanji characters here>"

Edit

Ok, ANK is Alphabet Numeric Kana, so i assume Japanese.
GBK is Guojia Biaozhun and mostly Chinese.
Neither are relevant to me.

vesperto
  • 804
  • 1
  • 6
  • 26
  • By the way, the page you are referring to in your question is about `ESC/POS`. The question title and tag `ESC/P` are similar, but strictly different. Which one is targeted and whether each command is supported depends on the printer vendor and model, so if they are clear, it is better to add them. – kunif Jun 12 '21 at 01:24
  • Corrected to ESC/POS, added more details. – vesperto Jan 21 '22 at 17:31

1 Answers1

0

ESC t toggles characters in the range 0x80-0xFF.

It is the main part of the process, the so-called code page or encoding.

ESC R toggles some characters in the range 0x20-0x7E.

Probably the handling of characters called the National Replacement Character Set.

National Replacement Character Set - Wikipedia

If necessary, you will need to combine and properly configure both to correspond to the code page and encoding.

kunif
  • 4,060
  • 2
  • 10
  • 30
  • IF i want to set `ESC t` with n=3 as per the documentation, am i to use `0x1B 0x74 0x03` or `0x1B 0x74 0x33` (the hex code for ASCII character '3')? – vesperto Feb 01 '22 at 16:20
  • 1
    For this control code, 0x33 would be another code page. Only 0x03 is valid. – kunif Feb 01 '22 at 22:01