Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to write separated Arabic letters?

Tags:

java

android

I'm making a program that accepts Arabic letters in EditText and those letters must be not linked together. And as far as I know, Arabic letters are linked together.

Example : Arabic letters like (كلب) should be like ( ك ل ب) of-course without spaces between letters

So how can I do to solve this issue or if there are any encodes must be with in XML file?

like image 849
Samy Louize Hanna Avatar asked Jan 17 '12 09:01

Samy Louize Hanna


3 Answers

As Porges said, use "\u200C" between two linked letters to separate them without " "

like image 55
Mosaed Avatar answered Oct 16 '22 13:10

Mosaed


You can try manually add spaces between each letter using a for-loop by doing something like this:

myEditText   = (EditText)findViewById(R.id.edittext);
String temp = myEditText.getText().toString();

for(int i = 0; i < temp.length(); i++){
     temp = temp.charAt(i) + " ";
}

myEditText.setText(temp);
like image 1
Jrom Avatar answered Oct 16 '22 14:10

Jrom


look into this http://www.unicodemap.org/range/85/Arabic_Presentation_Forms-B/ Unicode Map, when the user enters any new character, handle it with replacing the equivalent from the Map

like image 1
Mohammad Ersan Avatar answered Oct 16 '22 14:10

Mohammad Ersan