How to print Arabic text to thermal printers (Bixolon)
I am testing a Bixolon thermal printer for printing data from tablets. the tablet connects to the printer successfully via bluetooth and prints in English fine, but the problem is Arabic is printing strange characters. I'm pretty sure the default codepage is Arabic 864 (via self-test), but I don't know how I can send the correct characters. I tried converting it to Hex and then sending it over the codes below with no 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 there is a pdf in the printer documentation that lists the supported code pages and a table for each character in hex. but i don't know how i can solve the problem.
source to share