public static final int [ ] getCode ( String nameOrAbbrOrLocale ) { boolean triedCode = false ; if ( nameOrAbbrOrLocale . indexOf ( ' ' ) < 0 && nameOrAbbrOrLocale . indexOf ( ' ' ) < 0 ) { int propNum = UCharacter . getPropertyValueEnumNoThrow ( UProperty . SCRIPT , nameOrAbbrOrLocale ) ; if ( propNum != UProperty . UNDEFINED ) { return new int [ ] { propNum } ; } triedCode = true ; } int [ ] scripts = findCodeFromLocale ( new ULocale ( nameOrAbbrOrLocale ) ) ; if ( scripts != null ) { return scripts ; } if ( ! triedCode ) { int propNum = UCharacter . getPropertyValueEnumNoThrow ( UProperty . SCRIPT , nameOrAbbrOrLocale ) ; if ( propNum != UProperty . UNDEFINED ) { return new int [ ] { propNum } ; } } return null ; }
Gets the script codes associated with the given locale or ISO 15924 abbreviation or name . Returns MALAYAM given Malayam OR Mlym . Returns LATIN given en OR en_US