Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to invert direction of brackets (for a right to left text) for arabic language

When I am trying to use brackets in Arabic language, they are getting reversed as shown in the attached Screenshot.
I have tried using textDirection RTL and BidiFormatter, but none of them works.
The correct string is something like this "(باقة مسافر إسبوعي (مسبق".
Does anyone know, how to solve it?

like image 201
Chetna Avatar asked Jun 25 '14 10:06

Chetna


People also ask

What is RTL text?

RTL (Right To Left) is a locale property indicating that text is written from right to left. For example, the he locale (for Hebrew) specifies right-to-left. Arabic ( ar ) is another common language written RTL.

Which language is RTL?

Arabic, Hebrew and Persian are the most widespread RTL writing systems in modern times. As usage of the Arabic script spread, the repertoire of 28 characters used to write the Arabic language was supplemented to accommodate the sounds of many other languages such as Kashmiri, Pashto, etc.


1 Answers

I have found it. The solution is below:

String targetString = "\u200E"+originalString
like image 134
hong chainan Avatar answered Oct 11 '22 00:10

hong chainan