~ruther/guix-local

ref: b57b68aba645181b78bbdbef4ad908d60da03aa7 guix-local/gnu/packages/patches/icu4c-bug-1972781-chinese-based-calendar.patch -rw-r--r-- 1.2 KiB
b57b68ab — Cayetano Santos gnu: open-logic: Move to hdl 30 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
diff --git a/source/i18n/smpdtfmt.cpp b/source/i18n/smpdtfmt.cpp
--- a/source/i18n/smpdtfmt.cpp
+++ b/source/i18n/smpdtfmt.cpp
@@ -1523,18 +1523,19 @@ SimpleDateFormat::subFormat(UnicodeStrin
     }
 
     switch (patternCharIndex) {
 
     // for any "G" symbol, write out the appropriate era string
     // "GGGG" is wide era name, "GGGGG" is narrow era name, anything else is abbreviated name
     case UDAT_ERA_FIELD:
         {
-            if (typeid(cal) == typeid(ChineseCalendar) ||
-                typeid(cal) == typeid(DangiCalendar)) {
+            const char* type = cal.getType();
+            if (strcmp(type, "chinese") == 0 ||
+                strcmp(type, "dangi") == 0) {
                 zeroPaddingNumber(currentNumberFormat,appendTo, value, 1, 9); // as in ICU4J
             } else {
                 if (count == 5) {
                     _appendSymbol(appendTo, value, fSymbols->fNarrowEras, fSymbols->fNarrowErasCount);
                     capContextUsageType = DateFormatSymbols::kCapContextUsageEraNarrow;
                 } else if (count == 4) {
                     _appendSymbol(appendTo, value, fSymbols->fEraNames, fSymbols->fEraNamesCount);
                     capContextUsageType = DateFormatSymbols::kCapContextUsageEraWide;