~ruther/guix-local

ref: eaad0a367bb4a7e11076df959bddaff221aac381 guix-local/gnu/packages/patches/icu4c-bug-1972781-chinese-based-calendar.patch -rw-r--r-- 1.2 KiB
eaad0a36 — Nicolas Graves gnu: emacs-beancount: Update to 0.9.0-0.8a564f5. 4 months 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;