You can use ~CT
or ^CT
to change the tilde control character to any other ASCII character, and then you can print tildes normally. However, the new control character won't be printable. This is probably going to be quite a hassle to maintain.
An example changing the control command prefix to +
, taken from page 165 of the ZPL II programming guide:
^XA
^CT+
^XZ
+HS
If your string is represented as field data with ^FD
, ^FV
, or ^SN
, you can use ^FH
to encode the tilde in the string with its hex value, 7E.
An example, taken from page 192 of the ZPL II programming guide:
^XA
^FO100,100
^AD^FH
^FDTilde _7e used for HEX^FS
^XZ
Output:
Tilde ~ used for HEX