"<<<Ќ"
"&ք"
"<և"
+ "&🇿"
+ "< 🏴"
+ "< 🏴"
+ "< 🏴"
}
- Version{"31.0.1"}
+ Version{"31.0.2"}
}
private-unihan{
Sequence{
"&を < ヺ"
"&ゝ < ゞ"
"&ヽ < ヾ"
+ "&🇿"
+ "< 🏴"
+ "< 🏴"
+ "< 🏴"
}
- Version{"31.0.1"}
+ Version{"31.0.2"}
}
standard{
- Sequence{""}
- Version{"31.0.1"}
+ Sequence{
+ "&🇿"
+ "< 🏴"
+ "< 🏴"
+ "< 🏴"
+ }
+ Version{"31.0.2"}
}
}
depends:process(dependency){"ucadata.icu"}
"{1} {0}",
}
availableFormats{
+ E{"ccc"}
EHm{"E H:mm"}
EHms{"E H:mm:ss"}
Ed{"d E"}
Ehm{"E aK:mm"}
Ehms{"E aK:mm:ss"}
+ Gy{"y G"}
+ GyMMM{"MMM y G"}
GyMMMEd{"E, MMM d, y G"}
GyMMMd{"MMM d, y G"}
H{"H"}
Hm{"H:mm"}
Hms{"H:mm:ss"}
+ M{"L"}
MEd{"MM/dd E"}
+ MMM{"LLL"}
MMMEd{"E, MMM d"}
MMMMd{"MMMM d"}
MMMd{"MMM d"}
Md{"MM/dd"}
+ d{"d"}
+ h{"h a"}
+ hm{"h:mm a"}
+ hms{"h:mm:ss a"}
+ ms{"mm:ss"}
+ y{"y G"}
+ yyyy{"y G"}
yyyyM{"GGGGG y/MM"}
yyyyMEd{"GGGGG y/MM/dd E"}
+ yyyyMMM{"MMM y G"}
yyyyMMMEd{"E, MMM d, y G"}
+ yyyyMMMM{"MMMM y G"}
yyyyMMMd{"MMM d, y G"}
yyyyMd{"GGGGG y/MM/dd"}
}
intervalFormats{
+ H{
+ H{"HH – HH"}
+ }
+ Hm{
+ H{"HH:mm – HH:mm"}
+ m{"HH:mm – HH:mm"}
+ }
+ Hmv{
+ H{"HH:mm – HH:mm v"}
+ m{"HH:mm – HH:mm v"}
+ }
+ Hv{
+ H{"HH – HH v"}
+ }
+ M{
+ M{"M – M"}
+ }
MEd{
M{"MM/dd E – MM/dd E"}
d{"MM/dd E – MM/dd E"}
M{"MM/dd – MM/dd"}
d{"MM/dd – MM/dd"}
}
+ d{
+ d{"d – d"}
+ }
+ fallback{"{0} – {1}"}
+ h{
+ a{"h a – h a"}
+ h{"h – h a"}
+ }
+ hm{
+ a{"h:mm a – h:mm a"}
+ h{"h:mm – h:mm a"}
+ m{"h:mm – h:mm a"}
+ }
+ hmv{
+ a{"h:mm a – h:mm a v"}
+ h{"h:mm – h:mm a v"}
+ m{"h:mm – h:mm a v"}
+ }
+ hv{
+ a{"h a – h a v"}
+ h{"h – h a v"}
+ }
+ y{
+ y{"y – y G"}
+ }
yM{
M{"GGGGG y/MM – y/MM"}
y{"GGGGG y/MM – y/MM"}
"{1} {0}",
}
availableFormats{
+ E{"ccc"}
EHm{"E H:mm"}
EHms{"E H:mm:ss"}
Ed{"d E"}
Ehm{"E aK:mm"}
Ehms{"E aK:mm:ss"}
+ Gy{"y G"}
+ GyMMM{"MMM y G"}
GyMMMEd{"E, MMM d, y G"}
GyMMMd{"MMM d, y G"}
H{"H"}
Hm{"H:mm"}
Hms{"H:mm:ss"}
+ Hmsv{"HH:mm:ss v"}
+ Hmv{"HH:mm v"}
+ M{"L"}
MEd{"MM/dd E"}
+ MMM{"LLL"}
MMMEd{"E, MMM d"}
MMMMd{"MMMM d"}
MMMd{"MMM d"}
MMdd{"MM/dd"}
Md{"MM/dd"}
+ d{"d"}
+ h{"h a"}
+ hm{"h:mm a"}
+ hms{"h:mm:ss a"}
+ hmsv{"h:mm:ss a v"}
+ hmv{"h:mm a v"}
+ ms{"mm:ss"}
+ y{"y"}
yM{"y/MM"}
yMEd{"y/MM/dd E"}
+ yMMM{"MMM y"}
yMMMEd{"E, MMM d, y"}
+ yMMMM{"MMMM y"}
yMMMd{"MMM d, y"}
yMd{"y/MM/dd"}
}
intervalFormats{
+ H{
+ H{"HH – HH"}
+ }
+ Hm{
+ H{"HH:mm – HH:mm"}
+ m{"HH:mm – HH:mm"}
+ }
+ Hmv{
+ H{"HH:mm – HH:mm v"}
+ m{"HH:mm – HH:mm v"}
+ }
+ Hv{
+ H{"HH – HH v"}
+ }
+ M{
+ M{"M – M"}
+ }
MEd{
M{"MM/dd E – MM/dd E"}
d{"MM/dd E – MM/dd E"}
}
+ MMM{
+ M{"MMM – MMM"}
+ }
MMMEd{
M{"E, MMM d – E, MMM d"}
d{"E, MMM d – E, MMM d"}
M{"MM/dd – MM/dd"}
d{"MM/dd – MM/dd"}
}
+ d{
+ d{"d – d"}
+ }
+ fallback{"{0} – {1}"}
+ h{
+ a{"h a – h a"}
+ h{"h – h a"}
+ }
+ hm{
+ a{"h:mm a – h:mm a"}
+ h{"h:mm – h:mm a"}
+ m{"h:mm – h:mm a"}
+ }
+ hmv{
+ a{"h:mm a – h:mm a v"}
+ h{"h:mm – h:mm a v"}
+ m{"h:mm – h:mm a v"}
+ }
+ hv{
+ a{"h a – h a v"}
+ h{"h – h a v"}
+ }
+ y{
+ y{"y – y"}
+ }
yM{
M{"y/MM – y/MM"}
y{"y/MM – y/MM"}
d{"y/MM/dd E – y/MM/dd E"}
y{"y/MM/dd E – y/MM/dd E"}
}
+ yMMM{
+ M{"MMM – MMM y"}
+ y{"MMM y – MMM y"}
+ }
yMMMEd{
M{"E, MMM d – E, MMM d, y"}
d{"E, MMM d – E, MMM d, y"}
y{"E, MMM d, y – E, MMM d, y"}
}
+ yMMMM{
+ M{"MMMM – MMMM y"}
+ y{"MMMM y – MMMM y"}
+ }
yMMMd{
M{"MMM d – MMM d, y"}
d{"MMM d – d, y"}
static icu::Locale* availableLocaleList = NULL;
static int32_t availableLocaleListCount;
+#if !UCONFIG_NO_SERVICE
static icu::ICULocaleService* gService = NULL;
static icu::UInitOnce gServiceInitOnce = U_INITONCE_INITIALIZER;
+#endif
static icu::UInitOnce gAvailableLocaleListInitOnce;
/**
numerator / denominator : ((numerator + 1) / denominator) - 1;
}
+int64_t ClockMath::floorDivide(int64_t numerator, int64_t denominator) {
+ return (numerator >= 0) ?
+ numerator / denominator : ((numerator + 1) / denominator) - 1;
+}
+
int32_t ClockMath::floorDivide(double numerator, int32_t denominator,
int32_t& remainder) {
double quotient;
*/
static int32_t floorDivide(int32_t numerator, int32_t denominator);
+ /**
+ * Divide two integers, returning the floor of the quotient.
+ * Unlike the built-in division, this is mathematically
+ * well-behaved. E.g., <code>-1/4</code> => 0 but
+ * <code>floorDivide(-1,4)</code> => -1.
+ * @param numerator the numerator
+ * @param denominator a divisor which must be != 0
+ * @return the floor of the quotient
+ */
+ static int64_t floorDivide(int64_t numerator, int64_t denominator);
+
/**
* Divide two numbers, returning the floor of the quotient.
* Unlike the built-in division, this is mathematically
int32_t year, month, dayOfMonth, dayOfYear;
int32_t daysSinceEpoch = julianDay - PERSIAN_EPOCH;
- year = 1 + ClockMath::floorDivide(33 * daysSinceEpoch + 3, 12053);
+ year = 1 + (int32_t)ClockMath::floorDivide(33 * (int64_t)daysSinceEpoch + 3, (int64_t)12053);
int32_t farvardin1 = 365 * (year - 1) + ClockMath::floorDivide(8 * year + 21, 33);
dayOfYear = (daysSinceEpoch - farvardin1); // 0-based
int32_t *ixHigh,
UErrorCode *status)
{
- return (UCollationPCE::UCollationPCE(elems)).nextProcessed(ixLow, ixHigh, status);
+ return (UCollationPCE(elems)).nextProcessed(ixLow, ixHigh, status);
}
int32_t *ixHigh,
UErrorCode *status)
{
- return (UCollationPCE::UCollationPCE(elems)).previousProcessed(ixLow, ixHigh, status);
+ return (UCollationPCE(elems)).previousProcessed(ixLow, ixHigh, status);
}
U_NAMESPACE_BEGIN
void TestGetWindowsTimeZoneID(void);
void TestGetTimeZoneIDByWindowsID(void);
void TestClear(void);
+void TestPersianCalOverflow(void);
void TestGetDayPeriods(); /* Apple-specific */
void addCalTest(TestNode** root);
addTest(root, &TestGetWindowsTimeZoneID, "tsformat/ccaltst/TestGetWindowsTimeZoneID");
addTest(root, &TestGetTimeZoneIDByWindowsID, "tsformat/ccaltst/TestGetTimeZoneIDByWindowsID");
addTest(root, &TestClear, "tsformat/ccaltst/TestClear");
+ addTest(root, &TestPersianCalOverflow, "tsformat/ccaltst/TestPersianCalOverflow");
addTest(root, &TestGetDayPeriods, "tsformat/ccaltst/TestGetDayPeriods"); /* Apple-specific */
}
}
}
+void TestPersianCalOverflow() {
+ const char * locale = "bs_Cyrl@calendar=persian";
+ UErrorCode status = U_ZERO_ERROR;
+ UCalendar * ucal = ucal_open(NULL, 0, locale, UCAL_DEFAULT, &status);
+ if ( U_FAILURE(status) ) {
+ log_data_err("FAIL: ucal_open for locale %s, status %s\n", locale, u_errorName(status));
+ } else {
+ int32_t maxMonth = ucal_getLimit(ucal, UCAL_MONTH, UCAL_MAXIMUM, &status);
+ int32_t maxDayOfMonth = ucal_getLimit(ucal, UCAL_DATE, UCAL_MAXIMUM, &status);
+ if ( U_FAILURE(status) ) {
+ log_err("FAIL: ucal_getLimit MONTH/DATE for locale %s, status %s\n", locale, u_errorName(status));
+ } else {
+ int32_t jd, month, dayOfMonth;
+ for (jd = 67023580; jd <= 67023584; jd++) { // year 178171, int32_t overflow if jd >= 67023582
+ status = U_ZERO_ERROR;
+ ucal_clear(ucal);
+ ucal_set(ucal, UCAL_JULIAN_DAY, jd);
+ month = ucal_get(ucal, UCAL_MONTH, &status);
+ dayOfMonth = ucal_get(ucal, UCAL_DATE, &status);
+ if ( U_FAILURE(status) ) {
+ log_err("FAIL: ucal_get MONTH/DATE for locale %s, julianDay %d, status %s\n", locale, jd, u_errorName(status));
+ } else if (month > maxMonth || dayOfMonth > maxDayOfMonth) {
+ log_err("FAIL: locale %s, julianDay %d; maxMonth %d, got month %d; maxDayOfMonth %d, got dayOfMonth %d\n",
+ locale, jd, maxMonth, month, maxDayOfMonth, dayOfMonth);
+ }
+ }
+ }
+ ucal_close(ucal);
+ }
+}
+
/* Apple-specific */
typedef struct {
const char * locale;
static const UChar skel_Hmm[] = { 0x0048, 0x006D, 0x006D, 0 };
static const UChar skel_HHmm[] = { 0x0048, 0x0048, 0x006D, 0x006D, 0 };
static const UChar skel_hhmm[] = { 0x0068, 0x0068, 0x006D, 0x006D, 0 };
+static const UChar skel_mmss[] = { 0x006D, 0x006D, 0x0073, 0x0073, 0 };
+static const UChar skel_mmssSS[] = { 0x006D, 0x006D, 0x0073, 0x0073, 0x0053, 0x0053, 0 };
static const UChar patn_hcmm_a[] = { 0x0068, 0x003A, 0x006D, 0x006D, 0x0020, 0x0061, 0 }; /* h:mm a */
static const UChar patn_HHcmm[] = { 0x0048, 0x0048, 0x003A, 0x006D, 0x006D, 0 }; /* HH:mm */
static const UChar patn_hhcmm_a[] = { 0x0068, 0x0068, 0x003A, 0x006D, 0x006D, 0x0020, 0x0061, 0 }; /* hh:mm a */
static const UChar patn_hpmm_a[] = { 0x0068, 0x002E, 0x006D, 0x006D, 0x0020, 0x0061, 0 }; /* h.mm a */
static const UChar patn_Hpmm[] = { 0x0048, 0x002E, 0x006D, 0x006D, 0 }; /* H.mm */
static const UChar patn_hhpmm_a[] = { 0x0068, 0x0068, 0x002E, 0x006D, 0x006D, 0x0020, 0x0061, 0 }; /* hh.mm a */
+static const UChar patn_mmcss[] = { 0x006D, 0x006D, 0x003A, 0x0073, 0x0073, 0 }; /* mm:ss */
+static const UChar patn_mmcsspSS[]= { 0x006D, 0x006D, 0x003A, 0x0073, 0x0073, 0x002E, 0x0053, 0x0053, 0 }; /* mm:ss.SS */
static void TestOptions() {
const DTPtnGenOptionsData testData[] = {
{ "da", skel_Hmm, UDATPG_MATCH_HOUR_FIELD_LENGTH, patn_Hpmm },
{ "da", skel_HHmm, UDATPG_MATCH_HOUR_FIELD_LENGTH, patn_HHpmm },
{ "da", skel_hhmm, UDATPG_MATCH_HOUR_FIELD_LENGTH, patn_hhpmm_a },
+ { "en_JP@calendar=japanese", skel_mmss, UDATPG_MATCH_NO_OPTIONS, patn_mmcss },
+ { "en_JP@calendar=japanese", skel_mmssSS, UDATPG_MATCH_NO_OPTIONS, patn_mmcsspSS },
};
int count = UPRV_LENGTHOF(testData);
{ NULL, NULL, 0, NULL }
};
+static const UChar scFlagText[] = {
+/*00*/ 0xD83C,0xDDF3,0xD83C,0xDDFF, /*NZ*/
+/*04*/ 0xD83C,0xDFF4,0xDB40,0xDC67,0xDB40,0xDC62,0xDB40,0xDC65,0xDB40,0xDC6E,0xDB40,0xDC67,0xDB40,0xDC7F, /*gbeng*/
+/*18*/ 0x0061,0x0062,0x0063,
+/*21*/ 0xD83C,0xDFF4,0xDB40,0xDC67,0xDB40,0xDC62,0xDB40,0xDC73,0xDB40,0xDC63,0xDB40,0xDC74,0xDB40,0xDC7F, /*gbsct*/
+/*35*/ 0xD83C,0xDFF4,0xDB40,0xDC67,0xDB40,0xDC62,0xDB40,0xDC77,0xDB40,0xDC6C,0xDB40,0xDC73,0xDB40,0xDC7F, /*gbwls*/
+/*49*/ 0x0020,0
+};
+
+static const UChar scFlag1[] = { 0xD83C,0xDFF4,0xDB40,0xDC67,0xDB40,0xDC62,0xDB40,0xDC73,0xDB40,0xDC63,0xDB40,0xDC74,0xDB40,0xDC7F,0 }; /* gbsct */
+static const int32_t scOffFlag1[] = { 21 };
+static const int32_t scLenFlag1[] = { 14 };
+
+static const PatternAndOffsets scFlagPatternsOffsets[] = {
+ { scFlag1, scOffFlag1, UPRV_LENGTHOF(scOffFlag1), scLenFlag1 },
+ { NULL, NULL, 0, NULL }
+};
+
+
typedef struct {
const char * locale;
const UChar * text;
{ "ja@colStrength=primary", scJaText, scJaStndPatternsOffsets },
{ "ja@collation=search;colStrength=primary", scJaText, scJaSrchPatternsOffsets },
{ "root@collation=search;colStrength=primary", scModsText, scModsPatternsOffsets },
+ { "root@collation=search;colStrength=primary", scFlagText, scFlagPatternsOffsets },
{ NULL, NULL, NULL }
};