Zebra printer not printing unicode characters - unicode

I'm having some issues with a Zebra printer iMZ220, that when trying to print Unicode characters it simply skips the tag ^CI28 and doesn't print them. What is strange is that it was working at some point but it just doesn't seem to. Here's my ZPL testing code:
^XA
^PR14,14,14
^PW406
^LL70
^PON
^CI28
^FO20,20
^CF0,50
^FDTéste Acentós € £ $^FS
^XZ
Any help would be grateful. Thank you.

Related

How can i change font size of Zebra CPCL for printing

I have been working with an android mobile application on Flutter.
I need to print a label. I'm using a zebra printer that model is ZQ510.
When I send CPCL text to the printer by Bluetooth it works and prints out. But the printed output is really small. How can I make it bigger?
here is my CPCL text;
{D0611,0325,0591|}
{C|}
{XB00;0040,0369,A,3,02,0,0084,+0000000000,000,0,00=>512345678|}
{PC000;0094,0458,10,10,02,00,B=12345678|}
{PC001;0060,0048,10,10,01,00,B=149,95 |}
{PC002;0023,0170,10,10,02,00,B=Fiyat tarihi:|}
{PC003;0143,0170,10,10,02,00,B=24.08.2021|}
{PC004;0023,0215,10,10,03,00,B=T88001314CUT-|}
{PC005;0023,0240,10,10,03,00,B=GREY MARL-2-3 Y-|}
{PC006;0023,0271,10,10,02,00,B=Minecraft Tee|}
{PC007;0021,0313,10,10,02,00,B=Üretim Yeri:|}
{PC008;0143,0313,10,10,02,00,B=Türkiye|}
{LC;0063,0069,0199,0069,0,8|}
{PC009;0086,0113,10,10,01,00,B=49,99 |}
{PC000;0070,0500,06,06,010,00,B|}
{RC000;A|}
{XS;I,0001,0002C6200|}
Why do you need CPCL? IMO is kind of limited. Change your configuration to ZPL (instructions from zebra.com) and then use my source code from here
One more thing: keep in mind that if you want to print special language characters (I see that you need to print Turkish) you have to find the correct font that is installed in your printer. For example: In order to print Greek characters I have to integrate this
^CWN,E:TT0003M_.FNT
just after the first ^XA. Then I use the N font in order to print Greek. It is very flexible if you understand the basics
For example if you send this
^XA
^CWN,E:TT0003M_.FNT
^CI28
^CFN,20,20
^FO50,50^FDΧώρα Παραγωγής: ^FS
^FO50,90^FDΠεριοχή: ^FS
^CFN,30,30
^FO250,45^FDΕλλάδα^FS
^FO250,85^FDΒΙΠΕ Ηρακλείου^FS
^XZ
You will get this
Hope it helps

ZPL Utf-8 characters dissapearing

I've encountered a problem when trying to print a simple ZPL string.
My ZPL contains some UTF-8 characters like so:
^XA
^FT16,591^A0N,34^FH^FVM_F6lntorp^FS
^FT16,626^A0N,34^FH^FVV_E4gen^FS
^XZ
This should print out Mölntorp (_F6 = ö) and Vägen (_E4 = ä). And it does.
BUT, here comes the problem, I tried adding a danish ø (_F8 = ø), like so:
^XA
^FT16,626^A0N,34^FH^FVK_F8benhavnsvej
^XZ
But what comes out is K°benhavnsvej (which corresponds to _F8 = ° in CP-850). I have no clue why it successfully translates one hex code and then mucks up on the other one, since they should both be using the same encoding table. (None specified)
If I add ^CI28 below the starting ^XA tag, the UTF-8 characters simply vanish, and the output is just Kbenhavnsvej
I hope someone could give me input on why this is happening. It's frustrating.
^XA
^FT16,626^CI4^A0N,34^FH^FVK_7Cbenhavnsvej
^XZ
I haven't tried this - but it should work in theory.
^CI4 selects international character set for Denmark; character 7C should be the character you require (5C for upper-case)
This may also be the font you are using, the font simply might not contain this in its character set. You may have to use the Swiss Eastern European font.

Unicode for hindi printing on Zebra ZDR series printer

I am trying to print Unicode (for Hindi printing) using ZPL on Zebra printer ZDR500R. I am sending unicode file through 'Send file' in 'Tools' properties of Zebra printer. I have used various fonts like 'NT20WGL4.FNT', 'NK20WGL4.FNT', 'MONOBD15.FNT', H24.FNT', 'H12.FNT' etc. But none of them worked to print Hindi.
I am using following code for printing.
----------------------------------------------
^XA
^LH100,150
^CWT,E:MONOBD1524.FNT
^CFT,30,30
^CI28
^FT0,0^FH^FDTesting 1 2 3^FS
^FT0,50^FH^FD_905_924_93E_930_93F^FS
^FT0,100^B3^FDAAA001^FS
^XZ
-------------------------------------------
Here 905, 924, 93E, 930, 93F are unicode for hindi characters.
Plz help , how can i print Hindi characters of Unicode? Which Zebra font (.FNT) should i use?
Thanks & Regards.
The fonts you mentioned may not have the Hindi characters in them. Convert a TrueType font that has them (e.g., Mangal) to a Zebra FNT. The Zebra setup utility should be able to convert a TTF to an FNT for you.
Mangal comes with Windows. If you're not running Windows, you can find free Devanagari fonts lots of places online.

Print Chinese / Japanese character in Zebra Printer with ZPL

I have loaded the Mono Chinese/ Japanese font onto my ZM400 printer. So far I have no success printing both Chinese & English together on the same field.
Here is some example code:
^XA^CW1,B:ANMDS.TTF
^SEB:GB.DAT^CI14
^FO100,100^A1,50,50^FD中文English Here^FS
^XZ
Since I change the international code to 14 (with ^CI14), it only prints the Chinese text without the English text.
I have also try using the ^FL command, but can't seen to get it to work.
Does anyone have a working example of printing Chinese / Japanese text along with English text on the same FD (data field)?
You should probably use ^CI28 (UTF-8), and make sure that your labels are encoded in UTF-8.
As far as I know, ^CI14 only supports Asian encodings.
If anyone is looking at how to do this, I imagine what I did for Japanese will work for Chinese.
Firstly, I didn't want to purchase the Asian Font Pack because I think it's a bit of a ripoff, so I found an appropriate open source Japanese Unitype Font. I then uploaded this to the printer using Zebra Tools... make sure you upload it as a file, NOT using the font upload.
Then I managed to get it printing by escaping the characters.
So my final ZPL is
^XA
^LL150
^CI28^A#N,60,60,E:OSAKA.TTF
^FO0,0
^FH
^FD_5F_E3_81_93_E3_82_8C_E3_81_AF_E4_BD_95_E3_81_A8_E8_A8_80_E3_81_A3_E3_81_A6_E3_81_84_E3_81_BE_E3_81_99^FS
^XZ
Essentially you have to escape the bytes of each value (original Japanese これは何と言っています)
You also have to put ^FH in front of ^FD so it knows you're escaping characters.
Hopefully this helps the poster and anyone else who is looking to overcome problems with ZPL and Unicode fonts / characters.
I have figured out why. The Chinese text needs to be in gibberish format.
What I meant by gibberish is that. When you use Chinese in ZPL code, it needs to be in the windows codepage format text. This windows codepage format Text that is Chinese will be displayed as gibberish in English environment.
For example. In ZPL Code, your code might look like this:
^H ~!!####$ (this gibberish is actual the ASCII representation of Chinese text in windows code page format)
However, you can't type in unicode Chinese because ZPL would not print it.
^H 中文 (this is Chinese text in unicode format)

Encoding newlines in iCal files

I'm trying to figure out how to encode newlines in the DESCRIPTION part of an iCal file in such a way that they will import properly into Outlook, Google Calendar and the Apple Calendar.
The original code I inherited used "=0D=0A" with a quoted-printable encoding, which works great in Outlook, but not in Google Calendar.
The spec seems to say you should use "\n" to represent a newline. This works great in Google Calendar, but Outlook just puts the literal "\n" characters in there.
Is there a way you've done this that will work consistently accross calendaring systems?
OK, looks like I'm answering my own question.
The correct way to do it is to use "\n" for line breaks. Outlook did not recognize this because I had "ENCODING=quoted-printable" on the description. Once I removed that, Outlook displayed the new lines correctly.
Also, to get the file to open correctly in Apple iCal, you need to use "VERSION:2.0" for the file version. If you use "VERSION:1.0", it will tell you it can't read the file (even though it conforms to the 1.0 spec).
NOTE: As others have mentioned, the file actually has to contain the literal string \n. Since most languages treat that as an escape sequence meaning a newline character, you probably need to use the string \\n in your code.
The comment with the link to the RFC from Matthew Bucket above in the original post helped me. Quoting from there:
A BACKSLASH character in a "TEXT" property value MUST
be escaped with another BACKSLASH character
So, I did a
$description = str_replace("\r\n", "\\n", $description);
and it worked
Might be worth saying that you need the literal \n, not the newline symbol, literally backslash then n in the ical. Also don't forget to do the 75 character "folding" too.
Your output file should be like below---
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//2013//#Ur Site Name#//EN
BEGIN:VEVENT
UID:[event]2012
DTSTART:20130101T100000
DTEND:20130101T120000
LOCATION:
SUMMARY:#Meeting Title here#
DESCRIPTION:What is realistic for financial services companies to achieve via Social Media channels? \n\nJoin us on 11th September 2013 at 4pm (BST) where we
-----bla bla bla ----
END:VEVENT
END:VCALENDAR
Here you have to take care of Version, it should be 2.0 and Escape char ... \n(newline), semicolon(;) and comma(,). If you are writing in .net then it should like ... "\\n", "\\;" and "\\,".
You can check your output file on this site as well... https://icalendar.org/validator.html
Thanks,
Bhaskar
According to this RFC:
Content lines are delimited by a line break,
which is a CRLF sequence (CR character followed by LF character).
So you should use \r\n. I used this in strings without additional backslash escaping.
This is my answer for DESCRIPTION
$filev = str_replace("\r\n", '\\n', $p);
$filev = str_replace("<br>",'\\n',$filev);
$filev = (str_replace(";","\;",str_replace(",",'\,',$filev)));
I had to escape the output in the string to set a literal "\n" in the output file. Like so. Worked a charm.
$events .= "DESCRIPTION:" . str_replace("\n","\\n",str_replace(";","\;",str_replace(",",'\,',get_event_contents()))) . "\n";
=0D=0A works with Outlook, but you'll need to change the DESCRIPTION key, so that line breaks can be interpreted.
DESCRIPTION;ENCODING=QUOTED-PRINTABLE:
Enter your text after the colon, using =0D=0A for line breaks. Outlook will read the line breaks correctly. Using \\n only works if you're using DESCRIPTION without ENCODING:QUOTED-PRINTABLE.
I'm using VERSION:2.0