The bidi reference code is found in: http://www.unicode.org/Public/PROGRAMS/BidiReferenceJava and http://www.unicode.org/Public/PROGRAMS/BidiReferenceCpp There is an online demo of bidi code at http://unicode.org/cldr/utility/bidi.jsp, which shows the results, plus the levels and the rules invoked for each character.