蓝牙打印机不打印阿拉伯语(UTF-8)

时间:2019-03-26 16:42:37

标签: android printing bluetooth outputstream bluetooth-socket

我有一台蓝牙打印机,并且可以正常地从我的android应用程序打印英文字符,但是当我写阿拉伯字符时,其打印错误。我尝试在写入打印机时对输出流进行编码,但没有结果。这是我的代码

void sendData(){         尝试{

        // the text typed by the user
        String msg = myTextbox.getText().toString();
   mmOutputStream.write(msg.getBytes("ISO-8859-6"));

        // tell the user data were sent
        myLabel.setText("Data sent.");

    } catch (Exception e) {
        e.printStackTrace();
    }
}

0 个答案:

没有答案