Unable to print in Arabic on Xprinter XP-P810

when I try to send text content to my thermal printer it gives me the chinese symbols in case of Arabic and in case in English it give me the correct phrase

could you help me with this problem this is image that describe what I mean :
صورة واتساب بتاريخ 1445-04-08 في 14.30.23

صورة واتساب بتاريخ 1445-04-08 في 20.20.49

صورة واتساب بتاريخ 1445-04-08 في 21.28.55

:point_down:

صورة واتساب بتاريخ 1445-04-08 في 21.28.37

I thought firstly that my printer didn’t support Arabic but when I Used this app to send Arabic content it printed successfully

this is my function block :

 @SimpleFunction(description = "encode text")
public static List<Byte> generatePrintCommand(String charset, String text, boolean changeFont, int size, boolean bold, boolean underline, boolean feedline) {
    List<Byte> command = new ArrayList<>();

    // Set character encoding
    command.add((byte) 27);
    command.add((byte) 116);
    command.add((byte) charset.getBytes()[0]);

    // Add text to print
    command.add((byte) 27);
    command.add((byte) 33);
    int font = (changeFont ? 1 : 0) + (size << 2) + (bold ? 8 : 0) + (underline ? 128 : 0);
    command.add((byte) font);

    byte[] textBytes = text.getBytes();
    for (byte b : textBytes) {
        command.add(b);
    }

    // Feed line after printing
    if (feedline) {
        command.add((byte) 10);
        command.add((byte) 13);
    }

    return command;
}

this what I tried after connecting with printer :
blocks