~DE - Download Encoding Table
Downloads a character encoding table.
A TrueType font addresses its glyphs by Unicode code point, so the printer must
translate field data written in another encoding first. ~DE stores the table for
that translation, and the guide's example is a JIS table of 27,848 bytes. The
tables ship with Zebra's font packs, and nobody writes one by hand. The command
matters because a ^CI value in the double-byte Asian range is useless without
the matching table in memory.
Syntax
~DEd:o.x,s,dataSupport
Recognised as valid ZPL and not implemented, with no plan to.
Labelary does not support it either. Use ^CI28 and UTF-8 field data instead of a custom encoding table. — not pinned by a test
Labelary does not implement it either, so there is no parity reference.
Parameters
d:o.xTable fileoptional · textWhere to store the table: device R:, E:, B: or A:, a name of up to eight characters, and the fixed extension .DAT.
- Default
- R:UNKNOWN.DAT
- Invalid value
- discarded, and the default applies
- Test coverage
- The invalid-value rule is not pinned by a test.
sTable sizerequired · integerSize of the table in bytes. The data must carry exactly this many two-digit hexadecimal values.
- Invalid value
- enough to make the whole command be ignored. The printer ignores the whole command when the size is wrong or missing.
- Test coverage
- The invalid-value rule is not pinned by a test.
dataTable datarequired · hexadecimalThe table itself, as ASCII hexadecimal.
- Invalid value
- enough to make the whole command be ignored
- Test coverage
- The invalid-value rule is not pinned by a test.
Behavior
~DE acts on receipt and belongs outside ^XA … ^XZ. It prints nothing. The
printer stores the table under the given path, and then two commands select it.
^SE selects it explicitly. A ^CI value that names an encoding with a conversion
table selects it too, and the guide marks 14, 16, 24 and 26 that way. 15,
Shift-JIS, requires JIS.DAT.
The size and the data must agree exactly: the data is two hexadecimal digits per
byte, and s counts bytes. The guide ignores the whole command where either is
missing or wrong, and the failure is silent, with no diagnostic and no label to
look at.
The guide also describes the table layout, which matters for an inspection. Each entry is eight hexadecimal characters. The first four are the font's own encoding of the character, and the second four are the encoding of the data the host sends to the printer. The file must sort on the second four.
For anything new, ^CI28 with UTF-8 field data does the same job with no table
at all.
Differences from the specification
Labelary against the ZPL II guide
Where Labelary — our compatibility target — behaves differently from the printed specification.
- Labelary's table marks
~DEunsupported. — not pinned by a test
Example
The download, then the table being selected:
~DER:JIS.DAT,27848,300021213001
^XA
^SER:JIS.DAT
^FO50,50^A0N,40^FDField data read through the table^FS
^XZ
Related commands
^CIChange International Font / EncodingSelects the character encoding of the field data.~DUDownload Unbounded TrueType FontDownloads a TrueType font with a full, unrestricted character set.^SESelect EncodingSelects a downloaded encoding table.