code: public static boolean containsRTLText(String str)
    {
      if (str != null)
      {
        for (int i = 0; i < str.length(); i++)
        {
          char cc = str.charAt(i);
          // hebrew extended and basic, arabic basic and extendend
          if (cc >= 1425 && cc <= 1785)
          {
            return true;
          }
          // alphabetic presentations forms (hebrwew) to arabic presentation forms A
          else if (cc >= 64286 && cc <= 65019)
          {
            return true;
          }
          // arabic presentation forms B
          else if (cc >= 65136 && cc <= 65276)
          {
            return true;
          }
        }
      }
      return false;
    }
docs: Detects arabic characters in a string.
  
  <p>
  Every character is checked, if its bit representation lies between:
  <code>[1425, 1785] | [64286, 65019] | [65136, 65276]</code>
  
  </p>
  
  @param str The string to be checked.
  @return returns true, if arabic characters are detected.