Writing arabic text from text field to file in java

I have a program in which users can enter Arabic text in a text area. the Arabic direction of the text is right to left, and when I write the text to a file, the text changes direction from right to left. Can I write Arabic text to a file from right to left?

+4
source share
4 answers

Flip the text in memory, and then write to disk. Back to back ...

StringUtils.reverse(str) 
+1
source

You do not need. Its up to displaying the program to show it in the right direction. You can store the data in the file as it is, and the one who reads and displays it is responsible for this.

0
source

The directional direction depends on the program with which you open the file. All you can do is use Unicode, and if the opener has problems with Unicode, there is nothing you can do about it. The OS where the file is open must also support Unicode.

0
source

Refer to this blog . This will solve your problem.

0
source

Source: https://habr.com/ru/post/1344882/


All Articles