diff options
author | Steven R. Loomis <srloomis@us.ibm.com> | 2016-10-19 17:24:31 -0700 |
---|---|---|
committer | Steven R. Loomis <srloomis@us.ibm.com> | 2016-10-31 13:42:52 -0700 |
commit | 40366df885ec75c7eeee5e7e7626212ae1a6e770 (patch) | |
tree | 488aa7a7778b2a42083883540724def7d5eb4f50 /deps/icu-small/source/common/locmap.c | |
parent | 03023fa7ae060c082a014f792d5d1f481a599460 (diff) | |
download | android-node-v8-40366df885ec75c7eeee5e7e7626212ae1a6e770.tar.gz android-node-v8-40366df885ec75c7eeee5e7e7626212ae1a6e770.tar.bz2 android-node-v8-40366df885ec75c7eeee5e7e7626212ae1a6e770.zip |
deps: Intl: ICU 58 bump - small icu (BIG COMMIT)
This commit contains the ICU 58.1 delta.
It is especially large because of the ICU license change,
and, because the line endings were off previously.
* bump to ICU 58.1 - check in small ICU source
* from 58.1 final http://site.icu-project.org/download/58
Fixes: https://github.com/nodejs/node/issues/7844
PR-URL: https://github.com/nodejs/node/pull/9234
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'deps/icu-small/source/common/locmap.c')
-rw-r--r-- | deps/icu-small/source/common/locmap.c | 64 |
1 files changed, 35 insertions, 29 deletions
diff --git a/deps/icu-small/source/common/locmap.c b/deps/icu-small/source/common/locmap.c index f545a04d48..0d0aac42e1 100644 --- a/deps/icu-small/source/common/locmap.c +++ b/deps/icu-small/source/common/locmap.c @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** * Copyright (C) 1996-2016, International Business Machines @@ -213,11 +215,8 @@ ILCID_POSIX_ELEMENT_ARRAY(0x045c, chr,chr_US) ILCID_POSIX_SUBTABLE(ckb) { {0x92, "ckb"}, - {0x92, "ku"}, {0x7c92, "ckb_Arab"}, - {0x7c92, "ku_Arab"}, - {0x0492, "ckb_Arab_IQ"}, - {0x0492, "ku_Arab_IQ"} + {0x0492, "ckb_Arab_IQ"} }; /* Declared as cs_CZ to get around compiler errors on z/OS, which defines cs as a function */ @@ -1019,33 +1018,40 @@ uprv_convertToPosix(uint32_t hostid, char *posixID, int32_t posixIDCapacity, UEr const char *pPosixID = NULL; #ifdef USE_WINDOWS_LOCALE_API - int32_t tmpLen = 0; - char locName[157]; /* ULOC_FULLNAME_CAPACITY */ - - tmpLen = GetLocaleInfoA(hostid, LOCALE_SNAME, (LPSTR)locName, UPRV_LENGTHOF(locName)); - if (tmpLen > 1) { - /* Windows locale name may contain sorting variant, such as "es-ES_tradnl". - In such case, we need special mapping data found in the hardcoded table - in this source file. */ - char *p = uprv_strchr(locName, '_'); - if (p) { - /* Keep the base locale, without variant */ - *p = 0; - tmpLen = uprv_strlen(locName); - } else { - /* No hardcoded table lookup necessary */ - bLookup = FALSE; - } - /* Change the tag separator from '-' to '_' */ - p = locName; - while (*p) { - if (*p == '-') { - *p = '_'; + // Note: Windows primary lang ID 0x92 in LCID is used for Central Kurdish and + // GetLocaleInfo() maps such LCID to "ku". However, CLDR uses "ku" for + // Northern Kurdish and "ckb" for Central Kurdish. For this reason, we cannot + // use the Windows API to resolve locale ID for this specific case. + if (hostid & 0x3FF != 0x92) { + int32_t tmpLen = 0; + char locName[157]; /* ULOC_FULLNAME_CAPACITY */ + + tmpLen = GetLocaleInfoA(hostid, LOCALE_SNAME, (LPSTR)locName, UPRV_LENGTHOF(locName)); + if (tmpLen > 1) { + /* Windows locale name may contain sorting variant, such as "es-ES_tradnl". + In such case, we need special mapping data found in the hardcoded table + in this source file. */ + char *p = uprv_strchr(locName, '_'); + if (p) { + /* Keep the base locale, without variant */ + *p = 0; + tmpLen = uprv_strlen(locName); + } + else { + /* No hardcoded table lookup necessary */ + bLookup = FALSE; + } + /* Change the tag separator from '-' to '_' */ + p = locName; + while (*p) { + if (*p == '-') { + *p = '_'; + } + p++; } - p++; + FIX_LANGUAGE_ID_TAG(locName, tmpLen); + pPosixID = locName; } - FIX_LANGUAGE_ID_TAG(locName, tmpLen); - pPosixID = locName; } #endif if (bLookup) { |