문제

I have a problem with Zebra printer RW220 not printing serbian latin characters, like čćžšđ. I developed an android app which uses the printer. The printing part is based on Zebra SDK. Here's the part of the code:

private byte[] getConfigLabel() {
    PrinterLanguage printerLanguage = printer.getPrinterControlLanguage();
    byte[] configLabel = null;
    if (printerLanguage == PrinterLanguage.ZPL) {
        try {
            configLabel = "^XA^FO17,16^GB379,371,8^FS^FT65,255^A0N,135,134^FDTEST^FS^XZ".getBytes("UTF-8");
        } catch (UnsupportedEncodingException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    } else if (printerLanguage == PrinterLanguage.CPCL) {
        String cpclConfigLabel = "! 0 200 200 780 1\r\n" + "T ARIAL9PT.CPF 0 60 10 ABCČĆŽŠĐ\r\n"
        + "PRINT\r\n";
        configLabel = cpclConfigLabel.getBytes();
    }
    return configLabel;
}

The font used is Arial, which I converted using Zebra Utilities to CPF, for use with printer. I also added the characters to the font, but it doesn't print them. In this example, it just prints the ABC. And with the system fonts, it prints some strange characters. I also tried adding "ENCODING UTF-8" line before "T ARIAL9PT.CPF 0 60 10 ABCČĆŽŠĐ\r\n", but it doesn't do anything, same with the system fonts. How can I make it print serbian latin characters? Thanks.

EDIT: ISO-8859-2 prints Č and Ć, but not Ž.

도움이 되었습니까?

해결책

Finally solved, the solution was using the "CP1250" encoding, also known as Windows-1250.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top