5

Using version: ZPL2.

Format prefix: ^.

Can someone please help how to print caret(^) character using ZPL II. Either we need some escape sequence or any other way of printing this Format Prefix(^) as a normal character.

Note: Don't want to change the format prefix(^) to some other character.

Any help would be highly appreciated.

3 Answers 3

5

You need to use ^FH before your ^FD and then use the hex value of the caret : _5E

^XA
^FO100,100
^AD^FH
^FDCaret _5e used for HEX^FS
^XZ

See also : How to print a tilde (~) in Zebra Programming Language (ZPL)

Sign up to request clarification or add additional context in comments.

Comments

4

You can try to change format prefix of ZPL code which is ^ into different one ex. ¬ using ^CC. After print command, reverse the change back to ^.

^XA ^CC¬ ¬FO30,20¬FD_AB534^H¬FS ¬CC^ ^XZ

The ^FH and _5e solution is also good but will not work in all cases. If you use ^FH command it will convert everything which appear to be hex value

example - you want to print wifi password which is: _AB534^H. Normally you would use code:

^XA ^FO50,50 ^FD_AB534^H^FS ^XZ

this code will print only:_AB534

with ^FH command and replacing ^ with _5E will look like:

^XA ^FO50,50 ^FH^FD_AB534_5EH^FS ^XZ

it prints: ½534^H

Password is different than _AB534^H. this is because ^FH reads _AB as a HEX value and converts it as well

using this code:

^XA ^CC¬ ¬FO30,20¬FD_AB534^H¬FS ¬CC^ ^XZ

output is:_AB534^H

sign ¬ can not be entered simply from keyboard (without alt+ combination) so will not be used in wifi passwords.

Comments

0

Another option is to escape "_" as "_5f" and then escape "^" as "_5e". This protects against accidental decoding of a string already containing "_" without encoding every single character in ^FD, ^FV or ^SN commands.

In c#, this would be:

return value.Replace("_", "_5f").Replace("^", "_5e");

This is not the most efficient code, but is concise.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.