UTrie sprepTrie;
const uint16_t* mappingData;
UDataMemory* sprepData;
- const UBiDiProps *bdp; /* used only if checkBiDi is set */
int32_t refCount;
UBool isDataLoaded;
UBool doNFKC;
/* reset the object, all pointers NULL, all flags FALSE, all sizes 0 */
uprv_memset(pBiDi, 0, sizeof(UBiDi));
- /* get BiDi properties */
- pBiDi->bdp=ubidi_getSingleton();
-
/* allocate memory for arrays as requested */
if(maxLength>0) {
if( !getInitialDirPropsMemory(pBiDi, maxLength) ||
else
match=0;
if(match!=c && /* has a matching char */
- ubidi_getPairedBracketType(bd->pBiDi->bdp, c)==U_BPT_OPEN) { /* opening bracket */
+ ubidi_getPairedBracketType(c)==U_BPT_OPEN) { /* opening bracket */
/* special case: process synonyms
create an opening entry for each synonym */
if(match==0x232A) { /* RIGHT-POINTING ANGLE BRACKET */
if( pBiDi->fnClassCallback == NULL ||
(dir = (*pBiDi->fnClassCallback)(pBiDi->coClassCallback, c)) == U_BIDI_CLASS_DEFAULT )
{
- dir = ubidi_getClass(pBiDi->bdp, c);
+ dir = ubidi_getClass(c);
}
if(dir >= U_CHAR_DIRECTION_COUNT) {
dir = (UCharDirection)ON;
#define INCLUDED_FROM_UBIDI_PROPS_C
#include "ubidi_props_data.h"
-/* UBiDiProps singleton ----------------------------------------------------- */
-
-U_CFUNC const UBiDiProps *
-ubidi_getSingleton() {
- return &ubidi_props_singleton;
-}
-
/* set of property starts for UnicodeSet ------------------------------------ */
static UBool U_CALLCONV
}
U_CFUNC void
-ubidi_addPropertyStarts(const UBiDiProps *bdp, const USetAdder *sa, UErrorCode *pErrorCode) {
+ubidi_addPropertyStarts(const USetAdder *sa, UErrorCode *pErrorCode) {
int32_t i, length;
UChar32 c, start, limit;
}
/* add the start code point of each same-value range of the trie */
- utrie2_enum(&bdp->trie, NULL, _enumPropertyStartsRange, sa);
+ utrie2_enum(&ubidi_props_singleton.trie, NULL, _enumPropertyStartsRange, sa);
/* add the code points from the bidi mirroring table */
- length=bdp->indexes[UBIDI_IX_MIRROR_LENGTH];
+ length=ubidi_props_singleton.indexes[UBIDI_IX_MIRROR_LENGTH];
for(i=0; i<length; ++i) {
- c=UBIDI_GET_MIRROR_CODE_POINT(bdp->mirrors[i]);
+ c=UBIDI_GET_MIRROR_CODE_POINT(ubidi_props_singleton.mirrors[i]);
sa->addRange(sa->set, c, c+1);
}
/* add the code points from the Joining_Group array where the value changes */
- start=bdp->indexes[UBIDI_IX_JG_START];
- limit=bdp->indexes[UBIDI_IX_JG_LIMIT];
- jgArray=bdp->jgArray;
+ start=ubidi_props_singleton.indexes[UBIDI_IX_JG_START];
+ limit=ubidi_props_singleton.indexes[UBIDI_IX_JG_LIMIT];
+ jgArray=ubidi_props_singleton.jgArray;
for(;;) {
prev=0;
while(start<limit) {
/* add the limit code point if the last value was not 0 (it is now start==limit) */
sa->add(sa->set, limit);
}
- if(limit==bdp->indexes[UBIDI_IX_JG_LIMIT]) {
+ if(limit==ubidi_props_singleton.indexes[UBIDI_IX_JG_LIMIT]) {
/* switch to the second Joining_Group range */
- start=bdp->indexes[UBIDI_IX_JG_START2];
- limit=bdp->indexes[UBIDI_IX_JG_LIMIT2];
- jgArray=bdp->jgArray2;
+ start=ubidi_props_singleton.indexes[UBIDI_IX_JG_START2];
+ limit=ubidi_props_singleton.indexes[UBIDI_IX_JG_LIMIT2];
+ jgArray=ubidi_props_singleton.jgArray2;
} else {
break;
}
/* property access functions ------------------------------------------------ */
U_CFUNC int32_t
-ubidi_getMaxValue(const UBiDiProps *bdp, UProperty which) {
- int32_t max;
-
- if(bdp==NULL) {
- return -1;
- }
-
- max=bdp->indexes[UBIDI_MAX_VALUES_INDEX];
+ubidi_getMaxValue(UProperty which) {
+ int32_t max=ubidi_props_singleton.indexes[UBIDI_MAX_VALUES_INDEX];
switch(which) {
case UCHAR_BIDI_CLASS:
return (max&UBIDI_CLASS_MASK);
}
U_CAPI UCharDirection
-ubidi_getClass(const UBiDiProps *bdp, UChar32 c) {
- uint16_t props=UTRIE2_GET16(&bdp->trie, c);
+ubidi_getClass(UChar32 c) {
+ uint16_t props=UTRIE2_GET16(&ubidi_props_singleton.trie, c);
return (UCharDirection)UBIDI_GET_CLASS(props);
}
U_CFUNC UBool
-ubidi_isMirrored(const UBiDiProps *bdp, UChar32 c) {
- uint16_t props=UTRIE2_GET16(&bdp->trie, c);
+ubidi_isMirrored(UChar32 c) {
+ uint16_t props=UTRIE2_GET16(&ubidi_props_singleton.trie, c);
return (UBool)UBIDI_GET_FLAG(props, UBIDI_IS_MIRRORED_SHIFT);
}
static UChar32
-getMirror(const UBiDiProps *bdp, UChar32 c, uint16_t props) {
+getMirror(UChar32 c, uint16_t props) {
int32_t delta=UBIDI_GET_MIRROR_DELTA(props);
if(delta!=UBIDI_ESC_MIRROR_DELTA) {
return c+delta;
int32_t i, length;
UChar32 c2;
- mirrors=bdp->mirrors;
- length=bdp->indexes[UBIDI_IX_MIRROR_LENGTH];
+ mirrors=ubidi_props_singleton.mirrors;
+ length=ubidi_props_singleton.indexes[UBIDI_IX_MIRROR_LENGTH];
/* linear search */
for(i=0; i<length; ++i) {
}
U_CFUNC UChar32
-ubidi_getMirror(const UBiDiProps *bdp, UChar32 c) {
- uint16_t props=UTRIE2_GET16(&bdp->trie, c);
- return getMirror(bdp, c, props);
+ubidi_getMirror(UChar32 c) {
+ uint16_t props=UTRIE2_GET16(&ubidi_props_singleton.trie, c);
+ return getMirror(c, props);
}
U_CFUNC UBool
-ubidi_isBidiControl(const UBiDiProps *bdp, UChar32 c) {
- uint16_t props=UTRIE2_GET16(&bdp->trie, c);
+ubidi_isBidiControl(UChar32 c) {
+ uint16_t props=UTRIE2_GET16(&ubidi_props_singleton.trie, c);
return (UBool)UBIDI_GET_FLAG(props, UBIDI_BIDI_CONTROL_SHIFT);
}
U_CFUNC UBool
-ubidi_isJoinControl(const UBiDiProps *bdp, UChar32 c) {
- uint16_t props=UTRIE2_GET16(&bdp->trie, c);
+ubidi_isJoinControl(UChar32 c) {
+ uint16_t props=UTRIE2_GET16(&ubidi_props_singleton.trie, c);
return (UBool)UBIDI_GET_FLAG(props, UBIDI_JOIN_CONTROL_SHIFT);
}
U_CFUNC UJoiningType
-ubidi_getJoiningType(const UBiDiProps *bdp, UChar32 c) {
- uint16_t props=UTRIE2_GET16(&bdp->trie, c);
+ubidi_getJoiningType(UChar32 c) {
+ uint16_t props=UTRIE2_GET16(&ubidi_props_singleton.trie, c);
return (UJoiningType)((props&UBIDI_JT_MASK)>>UBIDI_JT_SHIFT);
}
U_CFUNC UJoiningGroup
-ubidi_getJoiningGroup(const UBiDiProps *bdp, UChar32 c) {
+ubidi_getJoiningGroup(UChar32 c) {
UChar32 start, limit;
- start=bdp->indexes[UBIDI_IX_JG_START];
- limit=bdp->indexes[UBIDI_IX_JG_LIMIT];
+ start=ubidi_props_singleton.indexes[UBIDI_IX_JG_START];
+ limit=ubidi_props_singleton.indexes[UBIDI_IX_JG_LIMIT];
if(start<=c && c<limit) {
- return (UJoiningGroup)bdp->jgArray[c-start];
+ return (UJoiningGroup)ubidi_props_singleton.jgArray[c-start];
}
- start=bdp->indexes[UBIDI_IX_JG_START2];
- limit=bdp->indexes[UBIDI_IX_JG_LIMIT2];
+ start=ubidi_props_singleton.indexes[UBIDI_IX_JG_START2];
+ limit=ubidi_props_singleton.indexes[UBIDI_IX_JG_LIMIT2];
if(start<=c && c<limit) {
- return (UJoiningGroup)bdp->jgArray2[c-start];
+ return (UJoiningGroup)ubidi_props_singleton.jgArray2[c-start];
}
return U_JG_NO_JOINING_GROUP;
}
U_CFUNC UBidiPairedBracketType
-ubidi_getPairedBracketType(const UBiDiProps *bdp, UChar32 c) {
- uint16_t props=UTRIE2_GET16(&bdp->trie, c);
+ubidi_getPairedBracketType(UChar32 c) {
+ uint16_t props=UTRIE2_GET16(&ubidi_props_singleton.trie, c);
return (UBidiPairedBracketType)((props&UBIDI_BPT_MASK)>>UBIDI_BPT_SHIFT);
}
U_CFUNC UChar32
-ubidi_getPairedBracket(const UBiDiProps *bdp, UChar32 c) {
- uint16_t props=UTRIE2_GET16(&bdp->trie, c);
+ubidi_getPairedBracket(UChar32 c) {
+ uint16_t props=UTRIE2_GET16(&ubidi_props_singleton.trie, c);
if((props&UBIDI_BPT_MASK)==0) {
return c;
} else {
- return getMirror(bdp, c, props);
+ return getMirror(c, props);
}
}
/* public API (see uchar.h) ------------------------------------------------- */
U_CFUNC UCharDirection
-u_charDirection(UChar32 c) {
- return ubidi_getClass(&ubidi_props_singleton, c);
+u_charDirection(UChar32 c) {
+ return ubidi_getClass(c);
}
U_CFUNC UBool
u_isMirrored(UChar32 c) {
- return ubidi_isMirrored(&ubidi_props_singleton, c);
+ return ubidi_isMirrored(c);
}
U_CFUNC UChar32
u_charMirror(UChar32 c) {
- return ubidi_getMirror(&ubidi_props_singleton, c);
+ return ubidi_getMirror(c);
}
U_STABLE UChar32 U_EXPORT2
u_getBidiPairedBracket(UChar32 c) {
- return ubidi_getPairedBracket(&ubidi_props_singleton, c);
+ return ubidi_getPairedBracket(c);
}
/* library API -------------------------------------------------------------- */
-struct UBiDiProps;
-typedef struct UBiDiProps UBiDiProps;
-
-U_CFUNC const UBiDiProps *
-ubidi_getSingleton(void);
-
U_CFUNC void
-ubidi_addPropertyStarts(const UBiDiProps *bdp, const USetAdder *sa, UErrorCode *pErrorCode);
+ubidi_addPropertyStarts(const USetAdder *sa, UErrorCode *pErrorCode);
/* property access functions */
U_CFUNC int32_t
-ubidi_getMaxValue(const UBiDiProps *bdp, UProperty which);
+ubidi_getMaxValue(UProperty which);
U_CAPI UCharDirection
-ubidi_getClass(const UBiDiProps *bdp, UChar32 c);
+ubidi_getClass(UChar32 c);
U_CFUNC UBool
-ubidi_isMirrored(const UBiDiProps *bdp, UChar32 c);
+ubidi_isMirrored(UChar32 c);
U_CFUNC UChar32
-ubidi_getMirror(const UBiDiProps *bdp, UChar32 c);
+ubidi_getMirror(UChar32 c);
U_CFUNC UBool
-ubidi_isBidiControl(const UBiDiProps *bdp, UChar32 c);
+ubidi_isBidiControl(UChar32 c);
U_CFUNC UBool
-ubidi_isJoinControl(const UBiDiProps *bdp, UChar32 c);
+ubidi_isJoinControl(UChar32 c);
U_CFUNC UJoiningType
-ubidi_getJoiningType(const UBiDiProps *bdp, UChar32 c);
+ubidi_getJoiningType(UChar32 c);
U_CFUNC UJoiningGroup
-ubidi_getJoiningGroup(const UBiDiProps *bdp, UChar32 c);
+ubidi_getJoiningGroup(UChar32 c);
U_CFUNC UBidiPairedBracketType
-ubidi_getPairedBracketType(const UBiDiProps *bdp, UChar32 c);
+ubidi_getPairedBracketType(UChar32 c);
U_CFUNC UChar32
-ubidi_getPairedBracket(const UBiDiProps *bdp, UChar32 c);
+ubidi_getPairedBracket(UChar32 c);
/* file definitions --------------------------------------------------------- */
*/
const UBiDi * pParaBiDi;
- const UBiDiProps *bdp;
-
/* alias pointer to the current text */
const UChar *text;
int32_t *matchLen1, int32_t *matchLen2,
UErrorCode *pErrorCode);
-/**
- * Are the Unicode properties loaded?
- * This must be used before internal functions are called that do
- * not perform this check.
- * Generate a debug assertion failure if data is not loaded.
- */
-U_CFUNC UBool
-uprv_haveProperties(UErrorCode *pErrorCode);
-
#ifdef __cplusplus
U_NAMESPACE_BEGIN
/* getting a uint32_t properties word from the data */
#define GET_PROPS(c, result) ((result)=UTRIE2_GET16(&propsTrie, c));
-U_CFUNC UBool
-uprv_haveProperties(UErrorCode *pErrorCode) {
- if(U_FAILURE(*pErrorCode)) {
- return FALSE;
- }
- return TRUE;
-}
-
/* API functions ------------------------------------------------------------ */
/* Gets the Unicode character's general category.*/
* To avoid dependency on other code, this list is hard coded here.
* When an ignorable code point is found and is unmappable, the default callbacks
* will ignore them.
- * For a list of the default ignorable code points, use this link: http://unicode.org/cldr/utility/list-unicodeset.jsp?a=[%3ADI%3A]&g=
+ * For a list of the default ignorable code points, use this link:
+ * https://unicode.org/cldr/utility/list-unicodeset.jsp?a=%5B%3ADI%3A%5D&abb=on&g=&i=
*
* This list should be sync with the one in CharsetCallback.java
*/
-#define IS_DEFAULT_IGNORABLE_CODE_POINT(c) (\
+#define IS_DEFAULT_IGNORABLE_CODE_POINT(c) ( \
(c == 0x00AD) || \
(c == 0x034F) || \
(c == 0x061C) || \
(0x180B <= c && c <= 0x180E) || \
(0x200B <= c && c <= 0x200F) || \
(0x202A <= c && c <= 0x202E) || \
- (c == 0x2060) || \
- (0x2066 <= c && c <= 0x2069) || \
- (0x2061 <= c && c <= 0x2064) || \
- (0x206A <= c && c <= 0x206F) || \
+ (0x2060 <= c && c <= 0x206F) || \
(c == 0x3164) || \
- (0x0FE00 <= c && c <= 0x0FE0F) || \
- (c == 0x0FEFF) || \
- (c == 0x0FFA0) || \
- (0x01BCA0 <= c && c <= 0x01BCA3) || \
- (0x01D173 <= c && c <= 0x01D17A) || \
- (c == 0x0E0001) || \
- (0x0E0020 <= c && c <= 0x0E007F) || \
- (0x0E0100 <= c && c <= 0x0E01EF) || \
- (c == 0x2065) || \
- (0x0FFF0 <= c && c <= 0x0FFF8) || \
- (c == 0x0E0000) || \
- (0x0E0002 <= c && c <= 0x0E001F) || \
- (0x0E0080 <= c && c <= 0x0E00FF) || \
- (0x0E01F0 <= c && c <= 0x0E0FFF) \
- )
+ (0xFE00 <= c && c <= 0xFE0F) || \
+ (c == 0xFEFF) || \
+ (c == 0xFFA0) || \
+ (0xFFF0 <= c && c <= 0xFFF8) || \
+ (0x1BCA0 <= c && c <= 0x1BCA3) || \
+ (0x1D173 <= c && c <= 0x1D17A) || \
+ (0xE0000 <= c && c <= 0xE0FFF))
/*Function Pointer STOPS at the ILLEGAL_SEQUENCE */
ucase_addPropertyStarts(&sa, &status);
break;
case UPROPS_SRC_BIDI:
- ubidi_addPropertyStarts(ubidi_getSingleton(), &sa, &status);
+ ubidi_addPropertyStarts(&sa, &status);
break;
default:
status = U_INTERNAL_PROGRAM_ERROR;
U_NAMESPACE_USE
-#define GET_BIDI_PROPS() ubidi_getSingleton()
-
/* general properties API functions ----------------------------------------- */
struct BinaryProperty;
}
static UBool isBidiControl(const BinaryProperty &/*prop*/, UChar32 c, UProperty /*which*/) {
- return ubidi_isBidiControl(GET_BIDI_PROPS(), c);
+ return ubidi_isBidiControl(c);
}
static UBool isMirrored(const BinaryProperty &/*prop*/, UChar32 c, UProperty /*which*/) {
- return ubidi_isMirrored(GET_BIDI_PROPS(), c);
+ return ubidi_isMirrored(c);
}
static UBool isJoinControl(const BinaryProperty &/*prop*/, UChar32 c, UProperty /*which*/) {
- return ubidi_isJoinControl(GET_BIDI_PROPS(), c);
+ return ubidi_isJoinControl(c);
}
#if UCONFIG_NO_NORMALIZATION
}
static int32_t getBiDiPairedBracketType(const IntProperty &/*prop*/, UChar32 c, UProperty /*which*/) {
- return (int32_t)ubidi_getPairedBracketType(GET_BIDI_PROPS(), c);
+ return (int32_t)ubidi_getPairedBracketType(c);
}
static int32_t biDiGetMaxValue(const IntProperty &/*prop*/, UProperty which) {
- return ubidi_getMaxValue(GET_BIDI_PROPS(), which);
+ return ubidi_getMaxValue(which);
}
#if UCONFIG_NO_NORMALIZATION
}
static int32_t getJoiningGroup(const IntProperty &/*prop*/, UChar32 c, UProperty /*which*/) {
- return ubidi_getJoiningGroup(GET_BIDI_PROPS(), c);
+ return ubidi_getJoiningGroup(c);
}
static int32_t getJoiningType(const IntProperty &/*prop*/, UChar32 c, UProperty /*which*/) {
- return ubidi_getJoiningType(GET_BIDI_PROPS(), c);
+ return ubidi_getJoiningType(c);
}
static int32_t getNumericType(const IntProperty &/*prop*/, UChar32 c, UProperty /*which*/) {
_shapeToArabicDigitsWithContext(UChar *s, int32_t length,
UChar digitBase,
UBool isLogical, UBool lastStrongWasAL) {
- const UBiDiProps *bdp;
int32_t i;
UChar c;
- bdp=ubidi_getSingleton();
digitBase-=0x30;
/* the iteration direction depends on the type of input */
if(isLogical) {
for(i=0; i<length; ++i) {
c=s[i];
- switch(ubidi_getClass(bdp, c)) {
+ switch(ubidi_getClass(c)) {
case U_LEFT_TO_RIGHT: /* L */
case U_RIGHT_TO_LEFT: /* R */
lastStrongWasAL=FALSE;
} else {
for(i=length; i>0; /* pre-decrement in the body */) {
c=s[--i];
- switch(ubidi_getClass(bdp, c)) {
+ switch(ubidi_getClass(c)) {
case U_LEFT_TO_RIGHT: /* L */
case U_RIGHT_TO_LEFT: /* R */
lastStrongWasAL=FALSE;
newProfile->doNFKC = (UBool)((newProfile->indexes[_SPREP_OPTIONS] & _SPREP_NORMALIZATION_ON) > 0);
newProfile->checkBiDi = (UBool)((newProfile->indexes[_SPREP_OPTIONS] & _SPREP_CHECK_BIDI_ON) > 0);
- if(newProfile->checkBiDi) {
- newProfile->bdp = ubidi_getSingleton();
- }
-
LocalMemory<UStringPrepKey> key;
LocalMemory<char> keyName;
LocalMemory<char> keyPath;
}
if(profile->checkBiDi) {
- direction = ubidi_getClass(profile->bdp, ch);
+ direction = ubidi_getClass(ch);
if(firstCharDir == U_CHAR_DIRECTION_COUNT){
firstCharDir = direction;
}
UBool
UTS46::isLabelOkContextJ(const UChar *label, int32_t labelLength) const {
- const UBiDiProps *bdp=ubidi_getSingleton();
// [IDNA2008-Tables]
// 200C..200D ; CONTEXTJ # ZERO WIDTH NON-JOINER..ZERO WIDTH JOINER
for(int32_t i=0; i<labelLength; ++i) {
}
// check precontext (Joining_Type:{L,D})(Joining_Type:T)*
for(;;) {
- UJoiningType type=ubidi_getJoiningType(bdp, c);
+ UJoiningType type=ubidi_getJoiningType(c);
if(type==U_JT_TRANSPARENT) {
if(j==0) {
return FALSE;
return FALSE;
}
U16_NEXT_UNSAFE(label, j, c);
- UJoiningType type=ubidi_getJoiningType(bdp, c);
+ UJoiningType type=ubidi_getJoiningType(c);
if(type==U_JT_TRANSPARENT) {
// just skip this character
} else if(type==U_JT_RIGHT_JOINING || type==U_JT_DUAL_JOINING) {
static void TestPropertyNames(void);
static void TestPropertyValues(void);
static void TestConsistency(void);
-static void TestUBiDiProps(void);
static void TestCaseFolding(void);
/* internal methods used */
addTest(root, &TestPropertyNames, "tsutil/cucdtst/TestPropertyNames");
addTest(root, &TestPropertyValues, "tsutil/cucdtst/TestPropertyValues");
addTest(root, &TestConsistency, "tsutil/cucdtst/TestConsistency");
- addTest(root, &TestUBiDiProps, "tsutil/cucdtst/TestUBiDiProps");
addTest(root, &TestCaseFolding, "tsutil/cucdtst/TestCaseFolding");
}
uset_close(set2);
}
-/*
- * Starting with ICU4C 3.4, the core Unicode properties files
- * (uprops.icu, ucase.icu, ubidi.icu, unorm.icu)
- * are hardcoded in the common DLL and therefore not included
- * in the data package any more.
- * Test requiring these files are disabled so that
- * we need not jump through hoops (like adding snapshots of these files
- * to testdata).
- * See Jitterbug 4497.
- */
-#define HARDCODED_DATA_4497 1
-
-/* API coverage for ubidi_props.c */
-static void TestUBiDiProps() {
-#if !HARDCODED_DATA_4497
- UDataMemory *pData;
- UBiDiProps *bdp;
- const UBiDiProps *cbdp;
- UErrorCode errorCode;
-
- /* coverage for ubidi_openBinary() */
- errorCode=U_ZERO_ERROR;
- pData=udata_open(NULL, UBIDI_DATA_TYPE, UBIDI_DATA_NAME, &errorCode);
- if(U_FAILURE(errorCode)) {
- log_data_err("unable to open " UBIDI_DATA_NAME "." UBIDI_DATA_TYPE ": %s\n",
- u_errorName(errorCode));
- return;
- }
-
- bdp=ubidi_openBinary((const uint8_t *)pData->pHeader, -1, &errorCode);
- if(U_FAILURE(errorCode)) {
- log_err("ubidi_openBinary() fails for the contents of " UBIDI_DATA_NAME "." UBIDI_DATA_TYPE ": %s\n",
- u_errorName(errorCode));
- udata_close(pData);
- return;
- }
-
- if(0x2215!=ubidi_getMirror(bdp, 0x29F5)) { /* verify some data */
- log_err("ubidi_openBinary() does not seem to return working UBiDiProps\n");
- }
-
- ubidi_closeProps(bdp);
- udata_close(pData);
-
- /* coverage for ubidi_getDummy() */
- errorCode=U_ZERO_ERROR;
- cbdp=ubidi_getDummy(&errorCode);
- if(ubidi_getClass(cbdp, 0x20)!=0) {
- log_err("ubidi_getClass(dummy, space)!=0\n");
- }
-#endif
-}
-
/* test case folding, compare return values with CaseFolding.txt ------------ */
/* bit set for which case foldings for a character have been tested already */
* To avoid dependency on other code, this list is hard coded here.
* When an ignorable code point is found and is unmappable, the default callbacks
* will ignore them.
- * For a list of the default ignorable code points, use this link: http://unicode.org/cldr/utility/list-unicodeset.jsp?a=[%3ADI%3A]&g=
- *
- * This list should be sync with the one in ucnv_err.c
+ * For a list of the default ignorable code points, use this link:
+ * https://unicode.org/cldr/utility/list-unicodeset.jsp?a=%5B%3ADI%3A%5D&abb=on&g=&i=
*
+ * This list should be sync with the one in ucnv_err.cpp.
*/
private static boolean IS_DEFAULT_IGNORABLE_CODE_POINT(int c) {
- return ((c == 0x00AD) ||
- (c == 0x034F) ||
- (c == 0x061C) ||
- (c == 0x115F) ||
- (c == 0x1160) ||
- (0x17B4 <= c && c <= 0x17B5) ||
- (0x180B <= c && c <= 0x180E) ||
- (0x200B <= c && c <= 0x200F) ||
- (0x202A <= c && c <= 0x202E) ||
- (c == 0x2060) ||
- (0x2066 <= c && c <= 0x2069) ||
- (0x2061 <= c && c <= 0x2064) ||
- (0x206A <= c && c <= 0x206F) ||
- (c == 0x3164) ||
- (0x0FE00 <= c && c <= 0x0FE0F) ||
- (c == 0x0FEFF) ||
- (c == 0x0FFA0) ||
- (0x01BCA0 <= c && c <= 0x01BCA3) ||
- (0x01D173 <= c && c <= 0x01D17A) ||
- (c == 0x0E0001) ||
- (0x0E0020 <= c && c <= 0x0E007F) ||
- (0x0E0100 <= c && c <= 0x0E01EF) ||
- (c == 0x2065) ||
- (0x0FFF0 <= c && c <= 0x0FFF8) ||
- (c == 0x0E0000) ||
- (0x0E0002 <= c && c <= 0x0E001F) ||
- (0x0E0080 <= c && c <= 0x0E00FF) ||
- (0x0E01F0 <= c && c <= 0x0E0FFF)
- );
+ return
+ (c == 0x00AD) ||
+ (c == 0x034F) ||
+ (c == 0x061C) ||
+ (c == 0x115F) ||
+ (c == 0x1160) ||
+ (0x17B4 <= c && c <= 0x17B5) ||
+ (0x180B <= c && c <= 0x180E) ||
+ (0x200B <= c && c <= 0x200F) ||
+ (0x202A <= c && c <= 0x202E) ||
+ (0x2060 <= c && c <= 0x206F) ||
+ (c == 0x3164) ||
+ (0xFE00 <= c && c <= 0xFE0F) ||
+ (c == 0xFEFF) ||
+ (c == 0xFFA0) ||
+ (0xFFF0 <= c && c <= 0xFFF8) ||
+ (0x1BCA0 <= c && c <= 0x1BCA3) ||
+ (0x1D173 <= c && c <= 0x1D17A) ||
+ (0xE0000 <= c && c <= 0xE0FFF);
}
/**
* Decoder Callback interface