title: How to find out locale-dependent text orientation in java?
body: <p>While I am writing a format and parse engine, I would like to find out - given a j.u.Locale, if the general text orientation is right-to-left (letter chars). What I have seen is:</p>
  
  <p>1.) Character#getDirectionality(char) This requires the knowledge of the concrete char to be parsed which is not always easy due to possible fill chars.</p>
  
  <p>2.) java.awt.ComponentOrientation#getOrientation(Locale) This method has two problems for me. First I would not like to be dependent on awt or other gui libraries (anticipating a possible later modularization of Java). Second and more important: The implementation of this method in OpenJDK and Android just use a very simple approach, namely: If the language is one of (ar, fa, iw, ur) then the method says RIGHT_TO_LEFT. But looking at <a href="http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes" rel="nofollow">Wikipedia-ISO-639</a> it appears that there are more languages which have a right-to-left-orientation, for example the ISO-639-code 'he' (hebrew).</p>
  
  <p>So my question now is, do you know a better approach? At the moment I tend just to use the Wikipedia list, that is, to refine the java.awt.ComponentOrientation approach with a better language list.</p>