Turkish character encoding issue while printing on ZQ220 with Zebra.Printer.SDK and Xamarin Forms

// Expert user has replied.
a ahmet kocadogan 2 years 9 months ago
243 2 0

Hello.

I have a Zebra ZQ220 CPCL printer. I designed my receipt like below. I trimmed it for posting here.

! 0 200 200 1550 1
ENCODING ASCII
T TH12.CPF 0 125 180 Tahsilat Makbuzu
T TH8.CPF 0 1 225 Tarih : 01.01.2022 Makbuz No : 45879
T TH8.CPF 0 1 260 CARİ : CARİ KOD
T TH8.CPF 0 0 285 ABCDEFGH şŞğĞüÜöÖçÇiİıI
PRINT

When i print this on my windows computer, from Zebra Setup Utilities / Direct Printer Communication or from a test application i coded in C#, i can print and see Turkish characters without an issue.

When i try to print same receipt from a Xamarin.Forms mobile application, i lose Turkish characters.

The documentation and the source code provided with Zebra Link OS SDK uses
private const string TestLabelCpcl = "! 0 200 200 406 1\r\n" +
"ON-FEED IGNORE\r\n" +
"BOX 20 20 380 380 8\r\n" +
"T 0 6 137 177 TESTÖÇŞİĞÜG\r\n" +
"PRINT\r\n";

And i use it like that, just change this string with the string above.

The implementation in GetTestLabelBytes() in the example code is : return Encoding.UTF8.GetBytes(TestLabelCpcl)
When i use UTF8, Turkish characters are printed wrong. Result is the same with Encoding.Default.
When i use Encoding.ASCII, Turkish characters printed as ?.
When i use Encoding.GetEncoding("ISO-8859-1"), Turkish characters are converted like, Ş to S, Ğ to G, but i can see the characters like Ç, Ö and Ü are printed correctly.

Which encoding should i use for printing from a Xamarin.Forms application? Is there any Zebra SDK spesific implementation for encoding ?

Please Register or Login to post a reply

2 Replies

J James Swinton-Bland

Hi,

Have you tried encoding: ISO 8859-9 ?

a ahmet kocadogan

Hello,

Yes I tried encoding ISO-8859-9 and no luck.

CONTACT
Can’t find what you’re looking for?