zpl.tools
Format control

^CT / ~CT - Change Tilde

Changes the character that introduces a control command.

^CT replaces the tilde that introduces the control commands — ~JA, ~DG, ~SD and the rest — and leaves the caret commands alone. Field data is the reason: a tilde in text has no escape, so the parser reads a value such as Lot ~JA5 as the cancel-all command and destroys the label. A change to the tilde makes the character inert everywhere, including inside ^FD. ^CT and ~CT are the same command, and after ~CT+ the control commands read +JA, +DG and so on.

Syntax

^CTa

Also accepted with the other prefix: ~CT.

Support

Supportedparsed: full · state: full · rendered: full

Every documented parameter renders the same output Labelary produces.

Labelary renders this command.

Parameters

aTilde characterrequired · single character

Character that replaces ~ as the control command prefix. Takes effect immediately and persists past ^XZ into the next label.

Invalid value
not possible — any value is accepted. The parser takes any single byte literally. With no argument the guide makes the next character received the new tilde, and the renderer does the same. At end of input the tilde stays.
Test coverage

Behavior

Only the control prefix moves. ^FO, ^FD and every other format command still start with a caret, which makes ^CT the cheap fix for tilde-bearing data, because nothing else about the format changes. Use

^CC for the caret, and both commands together where the data can contain either character.

The parser reads control commands outside ^XA^XZ as well as inside, so a ^CT in one format governs how a control command between formats reads. The change is parser state and persists past ^XZ. The guide's own example relies on that: it sets ^CT+ inside a format and then sends +HS after the ^XZ. On a printer, ^JUS makes the change survive a power cycle.

The argument is required, and the parser takes any ASCII character literally: a digit, a space or a newline all become the new tilde. Choose a character the data cannot contain, and not the caret or the current delimiter.

A changed tilde takes the control commands with it only, so ^CT never changes what a correct label looks like. Its whole value is in what it prevents.

Tested behavior

Differences from the specification

Labelary against the ZPL II guide

Where Labelary — our compatibility target — behaves differently from the printed specification.

  • Labelary documents the argument as optional with the default ~. The guide says it is required, and that a missing argument makes the next character received the new tilde. — not pinned by a test

zpl.tools against Labelary

Where our output differs from Labelary for the same input. These are the differences that break a migration.

  • With no argument the renderer takes the next byte as the tilde and still renders the label; Labelary renders no page. We measured this on 2026-07-30. — not pinned by a test

Example

Field data containing ~JA. With the ^CT+ line, the text prints.

^XA
^CT+
^FO50,50^A0N,30,30^FDLot ~JA5^FS
^XZ

Open in viewer