< prev index next >

src/java.base/share/classes/jdk/internal/icu/impl/UCharacterProperty.java

Print this page
rev 59210 : imported patch 8239383

*** 370,394 **** /* * Properties in vector word 0 * Bits * 31..24 DerivedAge version major/minor one nibble each ! * 23..22 3..1: Bits 7..0 = Script_Extensions index * 3: Script value from Script_Extensions * 2: Script=Inherited * 1: Script=Common ! * 0: Script=bits 7..0 ! * 21..20 reserved * 19..17 East Asian Width * 16.. 8 UBlockCode ! * 7.. 0 UScriptCode */ /** * Script_Extensions: mask includes Script */ ! public static final int SCRIPT_X_MASK = 0x00c000ff; //private static final int SCRIPT_X_SHIFT = 22; /** * Integer properties mask and shift values for East Asian cell width. * Equivalent to icu4c UPROPS_EA_MASK */ private static final int EAST_ASIAN_MASK_ = 0x000e0000; --- 370,403 ---- /* * Properties in vector word 0 * Bits * 31..24 DerivedAge version major/minor one nibble each ! * 23..22 3..1: Bits 21..20 & 7..0 = Script_Extensions index * 3: Script value from Script_Extensions * 2: Script=Inherited * 1: Script=Common ! * 0: Script=bits 21..20 & 7..0 ! * 21..20 Bits 9..8 of the UScriptCode, or index to Script_Extensions * 19..17 East Asian Width * 16.. 8 UBlockCode ! * 7.. 0 UScriptCode, or index to Script_Extensions */ + /** * Script_Extensions: mask includes Script */ ! public static final int SCRIPT_X_MASK = 0x00f000ff; //private static final int SCRIPT_X_SHIFT = 22; + + // The UScriptCode or Script_Extensions index is split across two bit fields. + // (Starting with Unicode 13/ICU 66/2019 due to more varied Script_Extensions.) + // Shift the high bits right by 12 to assemble the full value. + public static final int SCRIPT_HIGH_MASK = 0x00300000; + public static final int SCRIPT_HIGH_SHIFT = 12; + public static final int MAX_SCRIPT = 0x3ff; + /** * Integer properties mask and shift values for East Asian cell width. * Equivalent to icu4c UPROPS_EA_MASK */ private static final int EAST_ASIAN_MASK_ = 0x000e0000;
*** 407,419 **** * Equivalent to icu4c UPROPS_BLOCK_SHIFT */ private static final int BLOCK_SHIFT_ = 8; /** * Integer properties mask and shift values for scripts. ! * Equivalent to icu4c UPROPS_SHIFT_MASK */ ! public static final int SCRIPT_MASK_ = 0x000000ff; /** * Additional properties used in internal trie data */ /* --- 416,434 ---- * Equivalent to icu4c UPROPS_BLOCK_SHIFT */ private static final int BLOCK_SHIFT_ = 8; /** * Integer properties mask and shift values for scripts. ! * Equivalent to icu4c UPROPS_SHIFT_LOW_MASK. */ ! public static final int SCRIPT_LOW_MASK = 0x000000ff; ! ! public static final int mergeScriptCodeOrIndex(int scriptX) { ! return ! ((scriptX & SCRIPT_HIGH_MASK) >> SCRIPT_HIGH_SHIFT) | ! (scriptX & SCRIPT_LOW_MASK); ! } /** * Additional properties used in internal trie data */ /*
< prev index next >