POS for .NET - Arabic characters appear reversed.

Ahmed Dardeer 1 Reputation point
2024-04-11T23:24:12.76+00:00

Dears,

I have issue with printing Arabic characters in POS for .Net.

the Arabic word "مرحبا" appears "اب ح رم".

I have "EPSON TM-T20II".

I used "Epson.opos.tm.setpos.exe" to add device with character set "1256"

m_Printer.PrintNormal(PrinterStation.Receipt, "مرحبا" + "\n");

Please , assist.

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,385 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Jiale Xue - MSFT 31,981 Reputation points Microsoft Vendor
    2024-04-12T03:14:43.87+00:00

    Hi @Ahmed Dardeer , Welcome to Microsoft Q&A,

    Make sure your application correctly uses Unicode character encoding to handle Arabic text. In POS for .Net you should be able to print Arabic text using Unicode strings.

    Make sure your print format correctly supports RTL text. Sometimes, some printers may require special settings or formatting to print RTL text correctly.

    Here are some common methods, depending on the version and documentation of the POS for .Net library you are using:

    1. Use attributes to set text direction:
    
    // Assume you have a Printer object for printing
    
    Printer m_Printer = new Printer();
    
    //Set the text direction to RTL (right to left)
    
    m_Printer.TextDirection = TextDirection.RightToLeft;
    
    // print arabic text
    
    m_Printer.PrintNormal(PrinterStation.Receipt, "مرحبا\n");
    
    
    1. Call a specific method to set the text direction:
    
    // Assume you have a Printer object for printing
    
    Printer m_Printer = new Printer();
    
    // Use a specific method to set the text direction to RTL (right to left)
    
    m_Printer.SetRTL(true);
    
    // print arabic text
    
    m_Printer.PrintNormal(PrinterStation.Receipt, "مرحبا\n");
    
    
    1. Specify text direction in print method:
    
    // Assume you have a Printer object for printing
    
    Printer m_Printer = new Printer();
    
    // When printing Arabic text, specify the text direction as RTL (right to left) in the PrintNormal method
    
    m_Printer.PrintNormal(PrinterStation.Receipt, "\u202Eمرحبا\u202C\n"); // Use Unicode control characters to specify text direction
    
    

    Please note that these are just some examples and the specific methods and properties may vary depending on the version of the POS for .Net library.

    Best Regards,

    Jiale


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.