I’m writing an android application, and i need to recognize if the text i have in a String is written in a language that is RTL(right to left) ?
Thanks!
I’m writing an android application, and i need to recognize if the text i
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Two things:
A/ http://pastebin.com/e276zn6y Javascript code to determine the script of a character. Should give you an idea. And with the help of:
B/ ftp://unicode.org/Public/UNIDATA/extracted/DerivedBidiClass.txt
[…] truncated
which gives you the direction of all blocks (showing the beginning to the RTL section), you can figure out the rest.
EDIT:
You might also want to check for Right-To-Left format characters (U+20xx), see http://www.unicode.org/charts/PDF/U2000.pdf