commit de5c2a49d3c243bc29fcaa584faf3a0f78b8011c
parent af6559113407f1909485985b900dc2184221f0f6
Author: André Bargull <andre.bargull@gmail.com>
Date: Tue, 25 Nov 2025 15:19:26 +0000
Bug 2000225 - Part 3: Add patches for ICU bugs. r=platform-i18n-reviewers,jfkthame
Add patches to workaround ICU-23262 and ICU-23264.
Differential Revision: https://phabricator.services.mozilla.com/D273810
Diffstat:
3 files changed, 58 insertions(+), 0 deletions(-)
diff --git a/intl/icu-patches/bug-2000225-ICU-23262-missing-resource-error-for-iso8601-era.diff b/intl/icu-patches/bug-2000225-ICU-23262-missing-resource-error-for-iso8601-era.diff
@@ -0,0 +1,29 @@
+# Add empty era for iso8601 calendar.
+#
+# ICU bug: https://unicode-org.atlassian.net/browse/ICU-23262
+
+diff --git a/intl/icu/source/data/misc/supplementalData.txt b/intl/icu/source/data/misc/supplementalData.txt
+--- a/intl/icu/source/data/misc/supplementalData.txt
++++ b/intl/icu/source/data/misc/supplementalData.txt
+@@ -213,16 +213,21 @@ supplementalData:table(nofallback){
+ 622,
+ 7,
+ 18,
+ }
+ }
+ }
+ system{"lunar"}
+ }
++ iso8601{
++ eras{
++ }
++ system{"solar"}
++ }
+ japanese{
+ eras{
+ 0{
+ start:intvector{
+ 645,
+ 6,
+ 19,
+ }
diff --git a/intl/icu-patches/bug-2000225-ICU-23264-increase-measure-unit-capacity.diff b/intl/icu-patches/bug-2000225-ICU-23264-increase-measure-unit-capacity.diff
@@ -0,0 +1,27 @@
+# Increase measure unit capacity for ICU 78.
+#
+# ICU bug: https://unicode-org.atlassian.net/browse/ICU-23264
+
+diff --git a/intl/icu/source/i18n/number_skeletons.cpp b/intl/icu/source/i18n/number_skeletons.cpp
+--- a/intl/icu/source/i18n/number_skeletons.cpp
++++ b/intl/icu/source/i18n/number_skeletons.cpp
+@@ -1067,18 +1067,17 @@ void blueprint_helpers::parseMeasureUnit
+ }
+
+ // Need to do char <-> char16_t conversion...
+ CharString type;
+ SKELETON_UCHAR_TO_CHAR(type, stemString, 0, firstHyphen, status);
+ CharString subType;
+ SKELETON_UCHAR_TO_CHAR(subType, stemString, firstHyphen + 1, stemString.length(), status);
+
+- // Note: the largest type as of this writing (Aug 2020) is "volume", which has 33 units.
+- static constexpr int32_t CAPACITY = 40;
++ static constexpr int32_t CAPACITY = 50;
+ MeasureUnit units[CAPACITY];
+ UErrorCode localStatus = U_ZERO_ERROR;
+ int32_t numUnits = MeasureUnit::getAvailable(type.data(), units, CAPACITY, localStatus);
+ if (U_FAILURE(localStatus)) {
+ // More than 30 units in this type?
+ status = U_INTERNAL_PROGRAM_ERROR;
+ return;
+ }
diff --git a/intl/update-icu.sh b/intl/update-icu.sh
@@ -62,6 +62,8 @@ for patch in \
bug-1856290-ICU-20548-dateinterval-timezone.diff \
bug-1954138-dtitvfmt-adopt-calendar.diff \
bug-1972781-chinese-based-calendar.diff \
+ bug-2000225-ICU-23264-increase-measure-unit-capacity.diff \
+ bug-2000225-ICU-23262-missing-resource-error-for-iso8601-era.diff \
; do
echo "Applying local patch $patch"
patch -d ${icu_dir}/../../ -p1 --no-backup-if-mismatch < ${icu_dir}/../icu-patches/$patch