/*
**********************************************************************
- * Copyright (C) 1996-2014, International Business Machines
+ * Copyright (C) 1996-2016, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
*
* @param _posixID the full POSIX ID for this entry.
*/
#define ILCID_POSIX_MAP(_posixID) \
- {sizeof(locmap_ ## _posixID)/sizeof(ILcidPosixElement), locmap_ ## _posixID}
+ {UPRV_LENGTHOF(locmap_ ## _posixID), locmap_ ## _posixID}
/*
////////////////////////////////////////////
ILCID_POSIX_SUBTABLE(bo) {
{0x51, "bo"},
{0x0851, "bo_BT"},
- {0x0451, "bo_CN"}
+ {0x0451, "bo_CN"},
+ {0x0c51, "dz_BT"}
};
ILCID_POSIX_ELEMENT_ARRAY(0x047e, br, br_FR)
{0x340a, "es_CL"},
{0x240a, "es_CO"},
{0x140a, "es_CR"},
+ {0x5c0a, "es_CU"},
{0x1c0a, "es_DO"},
{0x300a, "es_EC"},
{0x0c0a, "es_ES"}, /*Modern sort.*/
ILCID_POSIX_SUBTABLE(ff) {
{0x67, "ff"},
{0x7c67, "ff_Latn"},
- {0x0867, "ff_Latn_SN"}
+ {0x0867, "ff_Latn_SN"},
+ {0x0467, "ff_NG"}
};
ILCID_POSIX_ELEMENT_ARRAY(0x040b, fi, fi_FI)
{0x0C6b, "quz_PE"}
};
-ILCID_POSIX_ELEMENT_ARRAY(0x0486, qut, qut_GT) /* qut is an ISO-639-3 code */
+ILCID_POSIX_SUBTABLE(quc) {
+ {0x93, "quc"},
+ {0x0493, "quc_CO"},
+ /*
+ "quc_Latn_GT" is an exceptional case. Language ID of "quc"
+ is 0x93, but LCID of "quc_Latn_GT" is 0x486, which should be
+ under the group of "qut". "qut" is a retired ISO 639-3 language
+ code for West Central Quiche, and merged to "quc".
+ It looks Windows previously reserved "qut" for K'iche', but,
+ decided to use "quc" when adding a locale for K'iche' (Guatemala).
+
+ This data structure used here assumes language ID bits in
+ LCID is unique for alphabetic language code. But this is not true
+ for "quc_Latn_GT". If we don't have the data below, LCID look up
+ by alphabetic locale ID (POSIX) will fail. The same entry is found
+ under "qut" below, which is required for reverse look up.
+ */
+ {0x0486, "quc_Latn_GT"}
+};
+
+ILCID_POSIX_SUBTABLE(qut) {
+ {0x86, "qut"},
+ {0x0486, "qut_GT"},
+ /*
+ See the note in "quc" above.
+ */
+ {0x0486, "quc_Latn_GT"}
+};
+
ILCID_POSIX_ELEMENT_ARRAY(0x0417, rm, rm_CH)
ILCID_POSIX_SUBTABLE(ro) {
ILCID_POSIX_SUBTABLE(sd) {
{0x59, "sd"},
{0x0459, "sd_IN"},
+ {0x0459, "sd_Deva_IN"},
{0x0859, "sd_PK"}
};
{0x7c5f, "tzm_Latn"},
{0x085f, "tzm_Latn_DZ"},
{0x105f, "tzm_Tfng_MA"},
+ {0x045f, "tzm_Arab_MA"},
{0x045f, "tmz"}
};
ILCID_POSIX_MAP(ps), /* ps Pashto 0x63 */
ILCID_POSIX_MAP(pt), /* pt Portuguese 0x16 */
ILCID_POSIX_MAP(qu), /* qu Quechua 0x6B */
+ ILCID_POSIX_MAP(quc), /* quc K'iche 0x93 */
ILCID_POSIX_MAP(qut), /* qut K'iche 0x86 */
ILCID_POSIX_MAP(rm), /* rm Raeto-Romance/Romansh 0x17 */
ILCID_POSIX_MAP(ro), /* ro Romanian 0x18 */
ILCID_POSIX_MAP(zu), /* zu Zulu 0x35 */
};
-static const uint32_t gLocaleCount = sizeof(gPosixIDmap)/sizeof(ILcidPosixMap);
+static const uint32_t gLocaleCount = UPRV_LENGTHOF(gPosixIDmap);
/**
* Do not call this function. It is called by hostID.
int32_t tmpLen = 0;
char locName[157]; /* ULOC_FULLNAME_CAPACITY */
- tmpLen = GetLocaleInfoA(hostid, LOCALE_SNAME, (LPSTR)locName, sizeof(locName)/sizeof(locName[0]));
+ 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