How to encode a TAB character in a Code128 barcode using only raw ZPL

In the past, we've used ZPL to create Code39 barcodes with a TAB character encoded in the middle using something similar to the following:

*USERNAME$IPASSWORD*

The $I in the middle gets translated to a TAB by the barcode scanners we use.

Now we have a need to do the same thing, but using Code128. With Code39, all the text needs to be uppercase (unless you're using Code39Extended, which supports lowercase letters). Because some of the data that is going to be encoded will be lowercase, we need to use Code128 B for most of the barcode, switching to Code128 A in the middle to encode the TAB character, then back to Code128 B for the final part.

Looking through the "ZPL II Programming Guide", it should be as easy as:

>:username>7{TAB}>6PA55w0rd

The >: at the beginning sets the subset to B, the >7 changes the subset to A, and the >6 changes the subset back to B. The problem I'm having (and haven't found a solution after almost a week of searching) is: How do I encode a TAB character using only text?


Use the ^FH (field hexidecimal encoding) command immediately prior to your field data. Based on your example:

^FH_^FD>:username>7_09>6PA55w0rd^FS

Where the underscore '_' is used as the escape character and 09 is the hex value for tab.

Also note that if the chosen escape character appears in the user name or password, you will need to escape it as well.