Printing degree symbol

I'm using a Xamarin Android app and using the Link-OS SDK to send the following to a ZQ520 over bluetooth and the degree symbol doesn't print correctly, I'm getting an extra character before it (see attachment). Anyone have any ideas?

ZebraPrinter printer = ZebraPrinterFactory.GetInstance(PrinterLanguage.CPCL, thePrinterConn);

printer.SendCommand($"! 0 200 200 100 1\r\n");

printer.SendCommand("JOURNAL\r\n");

printer.SendCommand("! U1 SETLP 5 2 30\r\n");

printer.SendCommand("CENTER\r\n");

printer.SendCommand("SETBOLD 1\r\n");

printer.SendCommand("TEXT 4 0 0 10 TENNESSEE FIRE 70°\r\n");

printer.SendCommand("FORM\r\n");

printer.SendCommand("PRINT\r\n");

Dmitry Prokhorov
Hello Jonathan,In case your

Hello Jonathan,

In case your string literals are unicode ones there is a chance you may need to use ENCODING command with "UTF-8" value

https://support.zebra.com/cpws/docs/comtec/PROMAN-CPCL_RevY.pdf#page=19

Also, could it be an option for you to switch to ZPL language that have a lot of printing capabilities?

Dmitry Prokhorov

Software Engineer, Kutir Mobility

Posted on behalf of Zebra Technologies

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Jonathan Titchener
Hi Dmitry,Thanks for the

Hi Dmitry,

Thanks for the response and the suggestion. I have already tried what you suggest and it did not make a difference. Referencing a newer document cpcl-link-os-pg-en.pdf there is no reference to the Encoding command, so, I wonder if it is even supported anymore? I did try the BIG5 (referenced in newer doc) option (COUNTRY BIG5) and interestingly it did not print the degree symbol or extra character at all.

Also, if I use the Link-OS SendCommand and send the second encoding parameter as "iso-8859-1" then the degree symbol prints correctly.

Now I'd like  to know of a global option to set so that I don't have to send this second parameter on each command.

Jonathan

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Dmitry Prokhorov
Hello Jonathan,Could you

Hello Jonathan,

Could you please to check if it will work this way:

thePrinterConn.write(TEXT 4 0 0 10 TENNESSEE FIRE 70°\r\n".getBytes("ISO-8859-1"));

using following example code:

BluetoothConnection (Zebra API for Android (build v2.14.5097))

In case it works then you will need to convert all your strings to byte arrays before sending them to a printer.

Dmitry Prokhorov

Software Engineer, Kutir Mobility

Posted on behalf of Zebra Technologies

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments