public static final boolean hasScript ( int c , int sc ) { int scriptX = UCharacterProperty . INSTANCE . getAdditional ( c , 0 ) & UCharacterProperty . SCRIPT_X_MASK ; if ( scriptX < UCharacterProperty . SCRIPT_X_WITH_COMMON ) { return sc == scriptX ; } char [ ] scriptExtensions = UCharacterProperty . INSTANCE . m_scriptExtensions_ ; int scx = scriptX & UCharacterProperty . SCRIPT_MASK_ ; // index into scriptExtensions if ( scriptX >= UCharacterProperty . SCRIPT_X_WITH_OTHER ) { scx = scriptExtensions [ scx + 1 ] ; } if ( sc > 0x7fff ) { // Guard against bogus input that would // make us go past the Script_Extensions terminator. return false ; } while ( sc > scriptExtensions [ scx ] ) { ++ scx ; } return sc == ( scriptExtensions [ scx ] & 0x7fff ) ; }
Do the Script_Extensions of code point c contain script sc? If c does not have explicit Script_Extensions then this tests whether c has the Script property value sc .