From 8a59268b64a7a30bbf8902f521fa77de0236d264 Mon Sep 17 00:00:00 2001 From: George Rhoten Date: Tue, 6 Mar 2001 02:39:47 +0000 Subject: [PATCH] ICU-865 os/390 porting for timezone X-SVN-Rev: 3913 --- icu4c/source/common/unicode/putil.h | 11 +++++++++++ icu4c/source/i18n/timezone.cpp | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/icu4c/source/common/unicode/putil.h b/icu4c/source/common/unicode/putil.h index 9c901c22d0c..57c5dcadb9a 100644 --- a/icu4c/source/common/unicode/putil.h +++ b/icu4c/source/common/unicode/putil.h @@ -271,4 +271,15 @@ u_versionToString(UVersionInfo versionArray, char *versionString); U_CAPI void U_EXPORT2 u_getVersion(UVersionInfo versionArray); +/* Define U_UPPER_ORDINAL */ +#if U_CHARSET_FAMILY==U_ASCII_FAMILY +# define U_UPPER_ORDINAL(x) ((x)-'A') +#elif U_CHARSET_FAMILY==U_EBCDIC_FAMILY +# define U_UPPER_ORDINAL(x) (((x) < 'J') ? ((x)-'A') : \ + (((x) < 'S') ? ((x)-'J'+9) : \ + (((x)-'S'+18)) +#else +# error Unknown charset family! +#endif + #endif diff --git a/icu4c/source/i18n/timezone.cpp b/icu4c/source/i18n/timezone.cpp index 48770d2a7be..67e9b4ae6ce 100644 --- a/icu4c/source/i18n/timezone.cpp +++ b/icu4c/source/i18n/timezone.cpp @@ -483,7 +483,7 @@ TimeZone::createAvailableIDs(const char* country, int32_t& numIDs) { uint16_t intcode = 0; if (country != NULL && *country != 0) { - intcode = ((country[0] - 'A') << 5) + (country[1] - 'A'); + intcode = (U_UPPER_ORDINAL(country[0]) << 5) + U_UPPER_ORDINAL(country[1]); } for (;;) {