我可以在希腊打印吗?

时间:2018-03-21 10:03:57

标签: android zebra-printers

你好我想问一个问题..我已经制作了一个按钮,当我按下那个按钮时,它会发送我想要在打印机上打印的信息,我想用希腊语打印,如果我改变ASCII,它就不会打印希腊语打印一些符号。任何帮助都是完美的..谢谢..这是我的代码

 final byte delimiter = 10;

        stopWorker = false;
        readBufferPosition = 0;
        readBuffer = new byte[1024];

        workerThread = new Thread(new Runnable() {
            public void run() {

                while (!Thread.currentThread().isInterrupted() && !stopWorker) {

                    try {

                        int bytesAvailable = inputStream.available();

                        if (bytesAvailable > 0) {

                            byte[] packetBytes = new byte[bytesAvailable];
                            inputStream.read(packetBytes);

                            for (int i = 0; i < bytesAvailable; i++) {

                                byte b = packetBytes[i];
                                if (b == delimiter) {

                                    byte[] encodedBytes = new byte[readBufferPosition];
                                    System.arraycopy(
                                            readBuffer, 0,
                                            encodedBytes, 0,
                                            encodedBytes.length
                                    );

                                    // specify US-ASCII encoding
                                    final String data = new String(encodedBytes, "UTF-8");
                                    readBufferPosition = 0;

1 个答案:

答案 0 :(得分:0)

此处没有关于您要打印的格式的信息。您需要格式化标签以使用UTF-8。

请参阅:Unicode characters on ZPL printer

相关问题