question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cyrillic symbols printing issue

See original GitHub issue

Hi! Sorry for my English in advance. I have an issue with printing Cyrillic symbols. The code I have written looks like this:

// Printing logo of the company
Bitonal algorithm = new BitonalThreshold(127);
BufferedImage  githubBufferedImage = getImage(image);
EscPosImage escposImage = new EscPosImage(new CoffeeImageImpl(githubBufferedImage), algorithm);

BitImageWrapper imageWrapper = new BitImageWrapper();

imageWrapper.setJustification(EscPosConst.Justification.Left_Default);
pos.write(imageWrapper, escposImage);
pos.feed(5);

// Text styling
Style headStyle = new Style()
                .setFontSize(Style.FontSize._1, Style.FontSize._1)
                .setJustification(EscPosConst.Justification.Center);

pos.setCharacterCodeTable(EscPos.CharacterCodeTable.CP866_Cyrillic_2);
pos.writeLF(headStyle, "Ваш номер очереди:");
pos.feed(1);

This is a one part of the code. Other parts are similar to this except styling and text itself to be printed. I am writing this code on Linux, then checking it on Windows machine, where Xprinter XP-80 is connected.

But all the text after printing is in Chinese or Japanese, idk. Only text in English is correct. I’ve tried all given options from ChacterCodeTable.

Then tried to print something from different application (Office Word, tried to write clear Java code), and the result is correct. Many thanks in advance.

Link to printed sample

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
alisherkasimovvcommented, Sep 13, 2020

@alisherkasimovv , take a look on #44 Graphic2D solution

@anastaciocintra, Yes, I saw it. My solution is similar in some sense, except saving drawn Strings to PNG file. I’ve created class where I am drawing all Strings to canvas with fixed sizes using Graphic2D. Then I saved canvas to PNG file and then printing it using escpos-coffee. Now, app is working in production with this solution. I am getting new customer demands, which I will add to next version of the app. That time I’ll check printing without intermediate file savings. Until then I am looking for another solutions))

0reactions
anastaciocintracommented, Sep 11, 2020

@alisherkasimovv , take a look on #44 Graphic2D solution

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cyrillic Letters are printed wrong - SAP Community
Hi experts, we have an unicode system and would like to print sapsript with cyrillic letters. If we print the sapscript as PDF...
Read more >
Office 2013 does not print files with cyrillic names
Hi all, I have the following issue. My printer does not print files with cyrillic names. OS: Windows 10, it doesn't give me...
Read more >
It is possible to print Cyrillic text? - Technical Support Portal
It is possible to print Cyrillic text combined with other special characters (e.g. ä,ö,ü,ß, etc). It is required to use CGTimes.
Read more >
Eclipse printing wrong cyrillic character - java - Stack Overflow
I am making an app that uses fiscal printer, and the document that i send to the printer must be in Cyrillic. The...
Read more >
Word 97+: Some Printers Will Not Print Russian Characters
go to folder Windows\System and find a file hpfcfg.exe · double-click on this file to execute it · Uncheck a check box called...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found