Click here to Skip to main content
15,891,253 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
I want to print print a file on Zebra iM320 but the file has special characters like "ç" and "ë". When I use encoding ISO-8859-1 it prints correctly but the letter is no aligned with the text. I tried everything but nothing works.

Java
String cpclConfigLabel = "! 0 200 200 1320 1\r\n"
        + "PW 575\r\n"
        + "ON-FEED IGNORE\r\n" 
        + "TONE 0\r\n" 
        + "SPEED 3\r\n"
        + "ON-FEED IGNORE\r\n" 
        + "NO-PACE\r\n" 
        + "BAR-SENSE\r\n"
        + "T 7 1 39 190 Masë Plotësuese\r\n";

  os.write(EncodingUtils.getBytes(cpclConfigLabel, "ISO-8859-1") );

os.flush();
os.close();


What I have tried:

tried this but nothing:
Java
os.write(EncodingUtils.getBytes(cpclConfigLabel, "CP1250"));

tried this too:
Java
configLabel = cpclConfigLabel.getBytes(Charset.forName("CP1250"));
os.write(configLabel);

tried different encoding also, it seems nothing works. The character "ë" is still not aligned with the word
Posted
Updated 12-Apr-16 22:00pm
v2
Comments
Sergey Alexandrovich Kryukov 12-Apr-16 23:11pm    
Wrong obsolete encoding, only used to support legacy data. It does not support characters you want. It does not need "try", you could just read about it. Normally, printers print such characters because the application prints in graphics; and all present-day technologies, including Java and Android, are totally based on Unicode.

However, it looks like you try to print using the POS printer. Such printers may support very limited repertoire of symbols which you would have to leave with. This kind of equipment is designed for low cost, not rich printing.

I saw only one POS system which prints beautifully well beyond ASCII, in a big Chinese supermarket in USA. It looks like Windows with normal graphical printers, shows comprehensive information on big color monitors and prints nicely in two languages. Everything else is cheap and damn primitive.

—SA
Richard Deeming 13-Apr-16 8:10am    
Google has lots of suggestions - for example:
Unicode characters on ZPL printer[^]

Looks like you need to combine UTF-8, ^FH, hex codes, and possibly a code page (^CInn).
Manuel Koliqi 17-Apr-16 20:01pm    
these answers are not working. @Richard the answer there in the link is totally different
Richard Deeming 18-Apr-16 8:07am    
Totally different to what?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900