I'm testing a Bixolon thermal printer to print data from tablets. A tablet connects to printer successfully via Bluetooth and print in English fine. However, the problem is with Arabic which it prints weird characters. I'm sure that default code page is Arabic 864 (through self test). I don't know how I can send correct characters. I have tried converting it to hex and sending it via codes below without success. It just prints like "d8b3d984d8a...":
text = String.format("%040x", new BigInteger(1, text.getBytes(Charset.forName("UTF-8"))));
MainActivity.mBixolonPrinter.printText(text, alignment, attribute, size, false);
I tried hex because the documentation of the printer lists supported code pages and a table for every character in hex. I don't know how I can solve the issue.