Java tutorial
public class Main { public static void main(String[] args) { char ch1 = 'M', ch2 = '\u06aa'; byte b1 = Character.getDirectionality(ch1); byte b2 = Character.getDirectionality(ch2); if (b1 == 0) { System.out.println("DIRECTIONALITY_LEFT_TO_RIGHT"); } if (b2 == 2) { System.out.println("DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC"); } } }