mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-08 15:05:53 +00:00
ICU-3635 handle _PREEURO correctly
X-SVN-Rev: 15680
This commit is contained in:
parent
b501ed1a54
commit
d95bb2171f
41 changed files with 241 additions and 335 deletions
|
@ -485,7 +485,7 @@ static const CanonicalizationMap CANONICALIZE_MAP[] = {
|
|||
{ "de__PHONEBOOK", "de", "collation", "phonebook" },
|
||||
{ "de_AT_PREEURO", "de_AT", "currency", "ATS" },
|
||||
{ "de_DE_PREEURO", "de_DE", "currency", "DEM" },
|
||||
{ "de_LU_PREEURO", "de_LU", "currency", "EUR" },
|
||||
{ "de_LU_PREEURO", "de_LU", "currency", "LUF" },
|
||||
{ "el_GR_PREEURO", "el_GR", "currency", "GRD" },
|
||||
{ "en_BOONT", "en__BOONT", NULL, NULL }, /* registered name */
|
||||
{ "en_SCOUSE", "en__SCOUSE", NULL, NULL }, /* registered name */
|
||||
|
|
|
@ -1679,7 +1679,7 @@ ures_open(const char* path,
|
|||
/*r->fParent = RES_BOGUS;*/
|
||||
r->fSize = res_countArrayItems(&(r->fResData), r->fRes);
|
||||
r->fResPath = NULL;
|
||||
|
||||
r->fResPathLen = 0;
|
||||
/*
|
||||
if(r->fData->fPath != NULL) {
|
||||
ures_setResPath(r, r->fData->fPath);
|
||||
|
@ -1776,6 +1776,7 @@ ures_openDirect(const char* path, const char* localeID, UErrorCode* status) {
|
|||
/*r->fParent = RES_BOGUS;*/
|
||||
r->fSize = res_countArrayItems(&(r->fResData), r->fRes);
|
||||
r->fResPath = NULL;
|
||||
r->fResPathLen = 0;
|
||||
r->fParentRes = NULL;
|
||||
r->fTopLevelData = r->fData;
|
||||
|
||||
|
|
|
@ -83,6 +83,8 @@ _res_getTableKey(const Resource *pRoot, const Resource res, int32_t indexS) {
|
|||
|
||||
static const char *
|
||||
_res_getTable32Key(const Resource *pRoot, const Resource res, int32_t indexS) {
|
||||
const int32_t offset = RES_GET_OFFSET(res);
|
||||
const Resource *temp = pRoot+res;
|
||||
const int32_t *p=(const int32_t *)RES_GET_POINTER(pRoot, res);
|
||||
if((uint32_t)indexS<(uint32_t)*p) {
|
||||
return RES_GET_KEY(pRoot, p[indexS+1]);
|
||||
|
@ -141,10 +143,11 @@ _res_findTableItem(const Resource *pRoot, const Resource res, const char *key,
|
|||
|
||||
/* did we really find it? */
|
||||
if(uprv_strcmp(key, RES_GET_KEY(pRoot, p[start]))==0) {
|
||||
Resource res = RES_BOGUS;
|
||||
*index=start;
|
||||
*realKey=RES_GET_KEY(pRoot, p[start]);
|
||||
limit=*(p-1); /* itemCount */
|
||||
return ((const Resource *)(p+limit+(~limit&1)))[start];
|
||||
res = ((const Resource *)(p+limit+(~limit&1)))[start];
|
||||
} else {
|
||||
*index=URESDATA_ITEM_NOT_FOUND;
|
||||
return RES_BOGUS; /* not found */
|
||||
|
@ -245,6 +248,7 @@ res_unload(ResourceData *pResData) {
|
|||
U_CFUNC const UChar *
|
||||
res_getString(const ResourceData *pResData, const Resource res, int32_t *pLength) {
|
||||
if(res!=RES_BOGUS && RES_GET_TYPE(res)==URES_STRING) {
|
||||
int32_t offset = RES_GET_OFFSET(res);
|
||||
const int32_t *p=(const int32_t *)RES_GET_POINTER(pResData->pRoot, res);
|
||||
if (pLength) {
|
||||
*pLength=*p;
|
||||
|
|
|
@ -369,10 +369,16 @@ ca {
|
|||
}
|
||||
ExemplarCharacters { "[a-z \u00e9 \u00ed \u00f3 \u00fa \u00e0 \u00e8 \u00f2 \u00ef \u00fc \u0140 \u00e7 \u00f1]" }
|
||||
|
||||
|
||||
// Currency display names
|
||||
Currencies {
|
||||
ESP { "\u20A7", "ESP" } // Spanish Peseta
|
||||
ESP {
|
||||
"\u20A7", "ESP" ,
|
||||
:array{
|
||||
"\u00A4 #,##0;-\u00A4 #,##0", /*currency pattern*/
|
||||
",", /*decimal sperator*/
|
||||
"." /*grouping separator*/
|
||||
}
|
||||
} // Spanish Peseta
|
||||
}
|
||||
calendar{
|
||||
gregorian{
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
// ***************************************************************************
|
||||
// *
|
||||
// * Copyright (C) 1997-2003, International Business Machines
|
||||
// * Corporation and others. All Rights Reserved.
|
||||
// *
|
||||
// ***************************************************************************
|
||||
|
||||
ca_ES_PREEURO {
|
||||
Version{ "2.0" }
|
||||
NumberPatterns {
|
||||
"#,##0.###;#,##0.###",
|
||||
"\u00A4 #,##0;-\u00A4 #,##0",
|
||||
"#,##0%",
|
||||
"#E0",
|
||||
}
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
// ***************************************************************************
|
||||
// *
|
||||
// * Copyright (C) 1997-2003, International Business Machines
|
||||
// * Corporation and others. All Rights Reserved.
|
||||
// *
|
||||
// ***************************************************************************
|
||||
|
||||
de_AT_PREEURO {
|
||||
Version { "2.0" }
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
// ***************************************************************************
|
||||
// *
|
||||
// * Copyright (C) 1997-2003, International Business Machines
|
||||
// * Corporation and others. All Rights Reserved.
|
||||
// *
|
||||
// ***************************************************************************
|
||||
|
||||
de_DE_PREEURO {
|
||||
Version { "2.0" }
|
||||
}
|
|
@ -24,6 +24,14 @@ de_LU {
|
|||
|
||||
// Currency display names
|
||||
Currencies {
|
||||
LUF { "F", "Luxemburgischer Franc" }
|
||||
LUF {
|
||||
"F",
|
||||
"Luxemburgischer Franc",
|
||||
:array{
|
||||
"#,##0 \u00A4;-#,##0 \u00A4", /*currency pattern*/
|
||||
".", /*decimal sperator*/
|
||||
",", /*grouping separator*/
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
// ***************************************************************************
|
||||
// *
|
||||
// * Copyright (C) 1997-2003, International Business Machines
|
||||
// * Corporation and others. All Rights Reserved.
|
||||
// *
|
||||
// ***************************************************************************
|
||||
|
||||
de_LU_PREEURO {
|
||||
Version { "2.0" }
|
||||
NumberPatterns {
|
||||
"#,##0.###;-#,##0.###",
|
||||
"#,##0 \u00A4;-#,##0 \u00A4",
|
||||
"#,##0%",
|
||||
"#E0",
|
||||
}
|
||||
}
|
|
@ -13,4 +13,15 @@ el_GR {
|
|||
"#,##0%",
|
||||
"#E0",
|
||||
}
|
||||
Currencies{
|
||||
GRD {
|
||||
"\u0394\u03C1\u03C7",
|
||||
"\u0394\u03C1\u03C7",
|
||||
:array{
|
||||
"#,##0.00 \u00A4;-#,##0.00 \u00A4", /*currency pattern*/
|
||||
",", /*decimal sperator*/
|
||||
".", /*grouping separator*/
|
||||
}
|
||||
} // Currency symbol is the same as the name. This may need to change.
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
// *******************************************************************************
|
||||
// *
|
||||
// * Copyright (C) 1997-2003, International Business Machines
|
||||
// * Corporation and others. All Rights Reserved.
|
||||
// *
|
||||
// *******************************************************************************
|
||||
|
||||
el_GR_PREEURO {
|
||||
Version { "2.0" }
|
||||
NumberPatterns {
|
||||
"#,##0.###;-#,##0.###",
|
||||
"#,##0.00 \u00A4;-#,##0.00 \u00A4",
|
||||
"#,##0%",
|
||||
"#E0",
|
||||
}
|
||||
|
||||
}
|
|
@ -7,7 +7,17 @@
|
|||
|
||||
en_BE {
|
||||
Version { "2.0" }
|
||||
|
||||
Currencies{
|
||||
BEF {
|
||||
"BF",
|
||||
"Belgian Franc",
|
||||
:array{
|
||||
"#,##0.00 \u00a4;-#,##0.00 \u00a4", /* currency pattern */
|
||||
",",/* decimal separator */
|
||||
".",/* grouping separator */
|
||||
}
|
||||
}
|
||||
}
|
||||
// LocaleString { "en_BE" }
|
||||
NumberElements {
|
||||
",",
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
// ***************************************************************************
|
||||
// *
|
||||
// * Copyright (C) 1997-2003, International Business Machines
|
||||
// * Corporation and others. All Rights Reserved.
|
||||
// *
|
||||
// ***************************************************************************
|
||||
|
||||
en_BE_PREEURO {
|
||||
Version { "2.0" }
|
||||
NumberPatterns {
|
||||
"#,##0.###;-#,##0.###",
|
||||
"#,##0.00 \u00a4;-#,##0.00 \u00a4",
|
||||
"#,##0%",
|
||||
"#E0",
|
||||
}
|
||||
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
// ***************************************************************************
|
||||
// *
|
||||
// * Copyright (C) 1997-2004, International Business Machines
|
||||
// * Corporation and others. All Rights Reserved.
|
||||
// *
|
||||
// ***************************************************************************
|
||||
|
||||
en_GB_EURO {
|
||||
Version{"2.0"}
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
// ***************************************************************************
|
||||
// *
|
||||
// * Copyright (C) 1997-2003, International Business Machines
|
||||
// * Corporation and others. All Rights Reserved.
|
||||
// *
|
||||
// ***************************************************************************
|
||||
|
||||
en_IE_PREEURO {
|
||||
Version { "2.0" }
|
||||
}
|
|
@ -28,6 +28,17 @@ es_ES {
|
|||
"#,##0%",
|
||||
"#E0",
|
||||
}
|
||||
Currencies{
|
||||
ESP {
|
||||
"\u20A7",
|
||||
"peseta espa\u00F1ola",
|
||||
:array{
|
||||
"#,##0 \u00A4;-#,##0 \u00A4", /*currency pattern*/
|
||||
",", /*decimal sperator*/
|
||||
"." /*grouping separator*/
|
||||
}
|
||||
}
|
||||
}
|
||||
calendar{
|
||||
gregorian{
|
||||
DateTimePatterns{
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
// ***************************************************************************
|
||||
// *
|
||||
// * Copyright (C) 1997-2003, International Business Machines
|
||||
// * Corporation and others. All Rights Reserved.
|
||||
// *
|
||||
// ***************************************************************************
|
||||
|
||||
es_ES_PREEURO {
|
||||
Version { "2.0" }
|
||||
NumberPatterns {
|
||||
"#,##0.###;-#,##0.###",
|
||||
"#,##0 \u00A4;-#,##0 \u00A4",
|
||||
"#,##0%",
|
||||
"#E0",
|
||||
}
|
||||
}
|
|
@ -232,7 +232,16 @@ eu {
|
|||
//ZW { "Zimbabwe" }
|
||||
}
|
||||
Currencies {
|
||||
ESP { "\u20A7", "ESP" }
|
||||
ESP {
|
||||
"\u20A7",
|
||||
"ESP",
|
||||
:array{
|
||||
"\u00A4 #,##0;-\u00A4 #,##0", /*currency pattern*/
|
||||
",", /*decimal sperator*/
|
||||
".", /*grouping separator*/
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Languages {
|
||||
eu { "euskara" }
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
// ***************************************************************************
|
||||
// *
|
||||
// * Copyright (C) 1997-2003, International Business Machines
|
||||
// * Corporation and others. All Rights Reserved.
|
||||
// *
|
||||
// ***************************************************************************
|
||||
|
||||
eu_ES_PREEURO {
|
||||
Version { "2.0" }
|
||||
NumberPatterns {
|
||||
"#,#0.##;-#,#0.##",
|
||||
"\u00a4 #,##0;-\u00a4 #,##0",
|
||||
"#,#0%",
|
||||
"#E0",
|
||||
}
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
// ***************************************************************************
|
||||
// *
|
||||
// * Copyright (C) 1997-2003, International Business Machines
|
||||
// * Corporation and others. All Rights Reserved.
|
||||
// *
|
||||
// ***************************************************************************
|
||||
|
||||
fi_FI_PREEURO {
|
||||
Version { "2.0" }
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
// ***************************************************************************
|
||||
// *
|
||||
// * Copyright (C) 1997-2003, International Business Machines
|
||||
// * Corporation and others. All Rights Reserved.
|
||||
// *
|
||||
// ***************************************************************************
|
||||
|
||||
fr_BE_PREEURO {
|
||||
Version { "2.0" }
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
// ***************************************************************************
|
||||
// *
|
||||
// * Copyright (C) 1997-2003, International Business Machines
|
||||
// * Corporation and others. All Rights Reserved.
|
||||
// *
|
||||
// ***************************************************************************
|
||||
|
||||
fr_FR_PREEURO {
|
||||
Version { "2.0" }
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
// ***************************************************************************
|
||||
// *
|
||||
// * Copyright (C) 1997-2003, International Business Machines
|
||||
// * Corporation and others. All Rights Reserved.
|
||||
// *
|
||||
// ***************************************************************************
|
||||
|
||||
fr_LU_PREEURO {
|
||||
Version { "2.0" }
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
// ***************************************************************************
|
||||
// *
|
||||
// * Copyright (C) 1997-2003, International Business Machines
|
||||
// * Corporation and others. All Rights Reserved.
|
||||
// *
|
||||
// ***************************************************************************
|
||||
|
||||
ga_IE_PREEURO {
|
||||
Version { "2.0" }
|
||||
}
|
|
@ -12,7 +12,16 @@ gl {
|
|||
}
|
||||
// Currency display names
|
||||
Currencies {
|
||||
ESP { "\u20A7", "ESP" } // Spanish Peseta
|
||||
ESP {
|
||||
"\u20A7",
|
||||
"ESP",
|
||||
:array{
|
||||
"\u00A4 #,##0;-\u00A4 #,##0", /*currency pattern*/
|
||||
",", /*decimal sperator*/
|
||||
".", /*grouping separator*/
|
||||
|
||||
}
|
||||
} // Spanish Peseta
|
||||
}
|
||||
Languages {
|
||||
gl { "galego" }
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
// ***************************************************************************
|
||||
// *
|
||||
// * Copyright (C) 1997-2003, International Business Machines
|
||||
// * Corporation and others. All Rights Reserved.
|
||||
// *
|
||||
// ***************************************************************************
|
||||
|
||||
gl_ES_PREEURO {
|
||||
Version { "2.0" }
|
||||
NumberPatterns {
|
||||
"#,#0.##;-#,#0.##",
|
||||
"\u00a4 #,##0;-\u00a4 #,##0",
|
||||
"#,#0%",
|
||||
"#E0",
|
||||
}
|
||||
}
|
|
@ -27,4 +27,15 @@ it_IT {
|
|||
}
|
||||
}
|
||||
}
|
||||
Currencies{
|
||||
ITL {
|
||||
"\u20A4",
|
||||
"Lira Italiana",
|
||||
:array{
|
||||
"\u00A4 #,##0;-\u00A4 #,##0", /* currency pattern */
|
||||
",", /* decimal separator */
|
||||
".", /* grouping separator */
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
// ***************************************************************************
|
||||
// *
|
||||
// * Copyright (C) 1997-2003, International Business Machines
|
||||
// * Corporation and others. All Rights Reserved.
|
||||
// *
|
||||
// ***************************************************************************
|
||||
|
||||
it_IT_PREEURO {
|
||||
Version{ "2.0" }
|
||||
NumberPatterns {
|
||||
"#,##0.###;-#,##0.###",
|
||||
"\u00A4 #,##0;-\u00A4 #,##0",
|
||||
"#,##0%",
|
||||
"#E0",
|
||||
}
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
// ***************************************************************************
|
||||
// *
|
||||
// * Copyright (C) 1997-2003, International Business Machines
|
||||
// * Corporation and others. All Rights Reserved.
|
||||
// *
|
||||
// ***************************************************************************
|
||||
|
||||
nl_BE_PREEURO {
|
||||
Version { "2.0" }
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
// ***************************************************************************
|
||||
// *
|
||||
// * Copyright (C) 1997-2003, International Business Machines
|
||||
// * Corporation and others. All Rights Reserved.
|
||||
// *
|
||||
// ***************************************************************************
|
||||
|
||||
nl_NL_PREEURO {
|
||||
Version { "2.0" }
|
||||
}
|
|
@ -87,7 +87,17 @@ pt_PT {
|
|||
YU { "Jugosl\u00E1via" }
|
||||
//ZW { "Zimbabwe" }
|
||||
}
|
||||
|
||||
Currencies{
|
||||
PTE {
|
||||
"Esc.",
|
||||
"Escudo portugu\u00eas",
|
||||
:array{
|
||||
"#,##0.00 \u00A4;-#,##0.00 \u00A4", /*currency pattern*/
|
||||
"$", /* decimal sperator*/
|
||||
",", /* grouping separator*/
|
||||
}
|
||||
}
|
||||
}
|
||||
Languages {
|
||||
ar { "\u00E1rabe" }
|
||||
cs { "checo" }
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
// ***************************************************************************
|
||||
// *
|
||||
// * Copyright (C) 1997-2003, International Business Machines
|
||||
// * Corporation and others. All Rights Reserved.
|
||||
// *
|
||||
// ***************************************************************************
|
||||
|
||||
pt_PT_PREEURO {
|
||||
Version { "2.0" }
|
||||
NumberPatterns {
|
||||
"#,##0.###;-#,##0.###",
|
||||
"#,##0 \u00A4;-#,##0 \u00A4",
|
||||
"#,##0%",
|
||||
"#E0",
|
||||
}
|
||||
NumberElements {
|
||||
",",
|
||||
".",
|
||||
";",
|
||||
"%",
|
||||
"0",
|
||||
"#",
|
||||
"-",
|
||||
"E",
|
||||
"\u2030",
|
||||
"\u221E",
|
||||
"\uFFFD",
|
||||
"$",
|
||||
"+",
|
||||
}
|
||||
}
|
|
@ -45,30 +45,30 @@ ar_SY.txt ar_TN.txt ar_YE.txt\
|
|||
be.txt be_BY.txt\
|
||||
bg.txt bg_BG.txt\
|
||||
bn.txt bn_IN.txt\
|
||||
ca.txt ca_ES.txt ca_ES_PREEURO.txt\
|
||||
ca.txt ca_ES.txt\
|
||||
cs.txt cs_CZ.txt\
|
||||
da.txt da_DK.txt\
|
||||
de.txt de_AT.txt de_AT_PREEURO.txt de_BE.txt de_CH.txt\
|
||||
de_DE.txt de_DE_PREEURO.txt de_LU.txt de_LU_PREEURO.txt\
|
||||
el.txt el_GR.txt el_GR_PREEURO.txt\
|
||||
en.txt en_AU.txt en_BE.txt en_BE_PREEURO.txt en_BW.txt en_CA.txt en_GB.txt en_GB_EURO.txt\
|
||||
en_HK.txt en_IE.txt en_IE_PREEURO.txt en_IN.txt en_NZ.txt en_PH.txt en_SG.txt en_MT.txt\
|
||||
de.txt de_AT.txt de_BE.txt de_CH.txt\
|
||||
de_DE.txt de_LU.txt\
|
||||
el.txt el_GR.txt\
|
||||
en.txt en_AU.txt en_BE.txt en_BW.txt en_CA.txt en_GB.txt\
|
||||
en_HK.txt en_IE.txt en_IN.txt en_NZ.txt en_PH.txt en_SG.txt en_MT.txt\
|
||||
en_US.txt en_US_POSIX.txt en_VI.txt en_ZA.txt en_ZW.txt\
|
||||
eo.txt\
|
||||
es.txt es_AR.txt es_BO.txt es_CL.txt es_CO.txt\
|
||||
es_CR.txt es_DO.txt es_EC.txt es_ES.txt es_ES_PREEURO.txt\
|
||||
es_CR.txt es_DO.txt es_EC.txt es_ES.txt\
|
||||
es_GT.txt es_HN.txt es_MX.txt es_NI.txt es_PA.txt\
|
||||
es_PE.txt es_PR.txt es_PY.txt es_SV.txt es_US.txt\
|
||||
es_UY.txt es_VE.txt\
|
||||
et.txt et_EE.txt\
|
||||
eu.txt eu_ES.txt eu_ES_PREEURO.txt\
|
||||
eu.txt eu_ES.txt\
|
||||
fa.txt fa_AF.txt fa_IR.txt\
|
||||
fi.txt fi_FI.txt fi_FI_PREEURO.txt\
|
||||
fi.txt fi_FI.txt\
|
||||
fo.txt fo_FO.txt\
|
||||
fr.txt fr_BE.txt fr_BE_PREEURO.txt fr_CA.txt fr_CH.txt\
|
||||
fr_FR.txt fr_FR_PREEURO.txt fr_LU.txt fr_LU_PREEURO.txt\
|
||||
ga.txt ga_IE.txt ga_IE_PREEURO.txt\
|
||||
gl.txt gl_ES.txt gl_ES_PREEURO.txt\
|
||||
fr.txt fr_BE.txt fr_CA.txt fr_CH.txt\
|
||||
fr_FR.txt fr_LU.txt\
|
||||
ga.txt ga_IE.txt\
|
||||
gl.txt gl_ES.txt\
|
||||
gv.txt gv_GB.txt\
|
||||
gu.txt gu_IN.txt\
|
||||
he.txt he_IL.txt\
|
||||
|
@ -78,7 +78,7 @@ hu.txt hu_HU.txt\
|
|||
hy.txt hy_AM.txt hy_AM_REVISED.txt\
|
||||
id.txt id_ID.txt\
|
||||
is.txt is_IS.txt\
|
||||
it.txt it_CH.txt it_IT.txt it_IT_PREEURO.txt\
|
||||
it.txt it_CH.txt it_IT.txt\
|
||||
ja.txt ja_JP.txt\
|
||||
kk.txt kk_KZ.txt\
|
||||
kl.txt kl_GL.txt\
|
||||
|
@ -93,13 +93,13 @@ mr.txt mr_IN.txt\
|
|||
ms.txt ms_MY.txt ms_BN.txt\
|
||||
mt.txt mt_MT.txt\
|
||||
nb.txt nb_NO.txt\
|
||||
nl.txt nl_BE.txt nl_BE_PREEURO.txt nl_NL.txt nl_NL_PREEURO.txt\
|
||||
nl.txt nl_BE.txt nl_NL.txt\
|
||||
nn.txt nn_NO.txt\
|
||||
om.txt om_ET.txt om_KE.txt\
|
||||
pa.txt pa_IN.txt\
|
||||
pl.txt pl_PL.txt\
|
||||
ps.txt ps_AF.txt\
|
||||
pt.txt pt_BR.txt pt_PT.txt pt_PT_PREEURO.txt\
|
||||
pt.txt pt_BR.txt pt_PT.txt\
|
||||
ro.txt ro_RO.txt\
|
||||
ru.txt ru_RU.txt ru_UA.txt\
|
||||
sh.txt sh_YU.txt\
|
||||
|
|
|
@ -301,14 +301,6 @@ root {
|
|||
ITL { "\u20A4", "ITL" } // Italian Lira
|
||||
JPY { "\u00A5", "JPY" } // Japanese Yen
|
||||
USD { "$", "USD" } // US Dollar
|
||||
PTE {
|
||||
"Esc.", "Escudo",
|
||||
Elements{
|
||||
"\u00A5 #,##0.00;(\u00A5 #,##0.00)", /*currency pattern*/
|
||||
"$", /*decimal sperator*/
|
||||
"." /*grouping separator*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Currency metadata. Unlike the "Currencies" element, this is
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
#include "unicode/ucurr.h"
|
||||
#include "unicode/curramt.h"
|
||||
#include "uhash.h"
|
||||
#include "cmemory.h"
|
||||
#include "iculserv.h"
|
||||
#include "ucln_in.h"
|
||||
#include "cstring.h"
|
||||
|
@ -392,7 +393,7 @@ NumberFormat::createInstance(const Locale& inLocale, UErrorCode& status)
|
|||
NumberFormat*
|
||||
NumberFormat::createCurrencyInstance(UErrorCode& status)
|
||||
{
|
||||
return createInstance(Locale::getDefault(), kCurrencyStyle, status);
|
||||
return createCurrencyInstance(Locale::getDefault(), status);
|
||||
}
|
||||
|
||||
// -------------------------------------
|
||||
|
@ -400,7 +401,7 @@ NumberFormat::createCurrencyInstance(UErrorCode& status)
|
|||
|
||||
NumberFormat*
|
||||
NumberFormat::createCurrencyInstance(const Locale& inLocale, UErrorCode& status)
|
||||
{
|
||||
{
|
||||
return createInstance(inLocale, kCurrencyStyle, status);
|
||||
}
|
||||
|
||||
|
@ -829,6 +830,7 @@ NumberFormat::makeInstance(const Locale& desiredLocale,
|
|||
}
|
||||
|
||||
ResourceBundle numberPatterns(resource.get(DecimalFormat::fgNumberPatterns, status));
|
||||
|
||||
// If not all the styled patterns exists for the NumberFormat in this locale,
|
||||
// sets the status code to failure and returns nil.
|
||||
//if (patternCount < fgNumberPatternsCount) status = U_INVALID_FORMAT_ERROR;
|
||||
|
@ -850,8 +852,35 @@ NumberFormat::makeInstance(const Locale& desiredLocale,
|
|||
|
||||
// Creates the specified decimal format style of the desired locale.
|
||||
if (style < numberPatterns.getSize()) {
|
||||
const UnicodeString pattern(numberPatterns.getStringEx(style, status));
|
||||
UnicodeString pattern(numberPatterns.getStringEx(style, status));
|
||||
if (U_SUCCESS(status)) {
|
||||
// Here we assume that the locale passed in is in the canonical
|
||||
// form, e.g: pt_PT_@currency=PTE not pt_PT_PREEURO
|
||||
if(style==kCurrencyStyle){
|
||||
char buf[20]={0};
|
||||
int32_t bufCap = 20;
|
||||
const char* locName = desiredLocale.getName();
|
||||
bufCap = uloc_getKeywordValue(locName, "currency", buf, bufCap, &status);
|
||||
if(bufCap > 0){
|
||||
ResourceBundle currencies(resource.getWithFallback("Currencies", status));
|
||||
ResourceBundle currency(currencies.getWithFallback(buf,status));
|
||||
if(currency.getSize()>2){
|
||||
ResourceBundle elements = currency.get(2, status);
|
||||
UnicodeString currPattern = elements.getStringEx(0, status);
|
||||
UnicodeString decimalSep = elements.getStringEx(1, status);
|
||||
UnicodeString groupingSep = elements.getStringEx(2, status);
|
||||
if(U_SUCCESS(status)){
|
||||
symbolsToAdopt->setSymbol(DecimalFormatSymbols::kGroupingSeparatorSymbol, groupingSep);
|
||||
symbolsToAdopt->setSymbol(DecimalFormatSymbols::kMonetarySeparatorSymbol, decimalSep);
|
||||
pattern = currPattern;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (U_FAILURE(status)) {
|
||||
delete symbolsToAdopt;
|
||||
return NULL;
|
||||
}
|
||||
f = new DecimalFormat(pattern, symbolsToAdopt, status);
|
||||
}
|
||||
else {
|
||||
|
@ -864,7 +893,7 @@ NumberFormat::makeInstance(const Locale& desiredLocale,
|
|||
// resource data in place.
|
||||
f = new DecimalFormat(fgLastResortNumberPatterns[style], symbolsToAdopt, status);
|
||||
}
|
||||
|
||||
|
||||
if (f == NULL) {
|
||||
status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return NULL;
|
||||
|
|
|
@ -1314,6 +1314,17 @@ static void TestObsoleteNames(void)
|
|||
|
||||
}
|
||||
|
||||
static UBool isCurrencyPreEuro(const char* currencyKey){
|
||||
if( strcmp(currencyKey, "PTE") == 0 ||
|
||||
strcmp(currencyKey, "ESP") == 0 ||
|
||||
strcmp(currencyKey, "LUF") == 0 ||
|
||||
strcmp(currencyKey, "GRD") == 0 ||
|
||||
strcmp(currencyKey, "BEF") == 0 ||
|
||||
strcmp(currencyKey, "ITL") == 0 ){
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
static void
|
||||
TestKeyInRootRecursive(UResourceBundle *root, const char *rootName,
|
||||
UResourceBundle *currentBundle, const char *locale) {
|
||||
|
@ -1327,13 +1338,14 @@ TestKeyInRootRecursive(UResourceBundle *root, const char *rootName,
|
|||
const char *currentBundleKey = NULL;
|
||||
|
||||
errorCode = U_ZERO_ERROR;
|
||||
currentBundleKey = ures_getKey(currentBundle);
|
||||
subBundle = ures_getNextResource(currentBundle, NULL, &errorCode);
|
||||
if (U_FAILURE(errorCode)) {
|
||||
log_err("Can't open a resource for locale %s\n", locale);
|
||||
log_err("Can't open a resource for locale %s. Error: %s\n", locale, u_errorName(errorCode));
|
||||
continue;
|
||||
}
|
||||
subBundleKey = ures_getKey(subBundle);
|
||||
currentBundleKey = ures_getKey(currentBundle);
|
||||
|
||||
|
||||
subRootBundle = ures_getByKey(root, subBundleKey, NULL, &errorCode);
|
||||
if (U_FAILURE(errorCode)) {
|
||||
|
@ -1460,7 +1472,7 @@ TestKeyInRootRecursive(UResourceBundle *root, const char *rootName,
|
|||
}
|
||||
|
||||
if ((subBundleKey == NULL
|
||||
|| (subBundleKey != NULL && strcmp(subBundleKey, "LocaleScript") != 0 && strcmp(subBundleKey, "PTE") != 0))
|
||||
|| (subBundleKey != NULL && strcmp(subBundleKey, "LocaleScript") != 0 && !isCurrencyPreEuro(subBundleKey)))
|
||||
&& ures_getSize(subRootBundle) != ures_getSize(subBundle))
|
||||
{
|
||||
log_err("Different size array with key \"%s\" in \"%s\" from root for locale \"%s\"\n"
|
||||
|
@ -2473,7 +2485,7 @@ static void TestCanonicalization(void)
|
|||
{ "ca_ES_PREEURO", "ca_ES_PREEURO", "ca_ES@currency=ESP" },
|
||||
{ "de_AT_PREEURO", "de_AT_PREEURO", "de_AT@currency=ATS" },
|
||||
{ "de_DE_PREEURO", "de_DE_PREEURO", "de_DE@currency=DEM" },
|
||||
{ "de_LU_PREEURO", "de_LU_PREEURO", "de_LU@currency=EUR" },
|
||||
{ "de_LU_PREEURO", "de_LU_PREEURO", "de_LU@currency=LUF" },
|
||||
{ "el_GR_PREEURO", "el_GR_PREEURO", "el_GR@currency=GRD" },
|
||||
{ "en_BE_PREEURO", "en_BE_PREEURO", "en_BE@currency=BEF" },
|
||||
{ "en_IE_PREEURO", "en_IE_PREEURO", "en_IE@currency=IEP" },
|
||||
|
|
|
@ -460,7 +460,7 @@ static void TestCurrencyPreEuro(void)
|
|||
|
||||
const char* result[]={
|
||||
"\\u20A7 2", "2 F", "\\u00A31.50", "1,50 mk", "1,50 F", "\\u20A4 2",
|
||||
"2 Esc.", "\\u00F6S 1,50", "1,50 \\u0394\\u03C1\\u03C7", "2 \\u20A7", "1,50 FB", "\\u00a31.50",
|
||||
"1$50 Esc.", "\\u00F6S 1,50", "1,50 \\u0394\\u03C1\\u03C7", "2 \\u20A7", "1,50 FB", "\\u00a31.50",
|
||||
"1,50 BF", "1,50 DM", "1,50 BF", "\\u20A7 2", "1,50 F", "\\u20A7 2",
|
||||
"fl 1,50"
|
||||
};
|
||||
|
@ -468,7 +468,13 @@ static void TestCurrencyPreEuro(void)
|
|||
log_verbose("\nTesting the number format with different currency patterns\n");
|
||||
for(i=0; i < 19; i++)
|
||||
{
|
||||
currencyFmt = unum_open(UNUM_CURRENCY, NULL,0,locale[i],NULL, &status);
|
||||
char curID[256] = {0};
|
||||
int len = uloc_canonicalize(locale[i], curID, 256, &status);
|
||||
if(U_FAILURE(status)){
|
||||
log_err("Could not canonicalize %s. Error: %s \n", locale[i], u_errorName(status));
|
||||
continue;
|
||||
}
|
||||
currencyFmt = unum_open(UNUM_CURRENCY, NULL,0,curID,NULL, &status);
|
||||
if(U_FAILURE(status)){
|
||||
log_err("Error in the construction of number format with style currency:\n%s\n",
|
||||
myErrorName(status));
|
||||
|
|
|
@ -2005,7 +2005,7 @@ void LocaleTest::TestCanonicalization(void)
|
|||
{ "ca_ES_PREEURO", "ca_ES_PREEURO", "ca_ES@currency=ESP" },
|
||||
{ "de_AT_PREEURO", "de_AT_PREEURO", "de_AT@currency=ATS" },
|
||||
{ "de_DE_PREEURO", "de_DE_PREEURO", "de_DE@currency=DEM" },
|
||||
{ "de_LU_PREEURO", "de_LU_PREEURO", "de_LU@currency=EUR" },
|
||||
{ "de_LU_PREEURO", "de_LU_PREEURO", "de_LU@currency=LUF" },
|
||||
{ "el_GR_PREEURO", "el_GR_PREEURO", "el_GR@currency=GRD" },
|
||||
{ "en_BE_PREEURO", "en_BE_PREEURO", "en_BE@currency=BEF" },
|
||||
{ "en_IE_PREEURO", "en_IE_PREEURO", "en_IE@currency=IEP" },
|
||||
|
|
|
@ -582,7 +582,18 @@ NumberFormatTest::escape(UnicodeString& s)
|
|||
|
||||
|
||||
// -------------------------------------
|
||||
|
||||
static const char* testCases[][2]= {
|
||||
/* locale ID */ /* expected */
|
||||
{"ca_ES_PREEURO", "\\u20A7 1.150" },
|
||||
{"de_LU_PREEURO", "1,150 F" },
|
||||
{"el_GR_PREEURO", "1.150,50 \\u0394\\u03C1\\u03C7" },
|
||||
{"en_BE_PREEURO", "1.150,50 BF" },
|
||||
{"es_ES_PREEURO", "1.150 \\u20A7" },
|
||||
{"eu_ES_PREEURO", "\\u20A7 1.150" },
|
||||
{"gl_ES_PREEURO", "\\u20A7 1.150" },
|
||||
{"it_IT_PREEURO", "\\u20A4 1.150" },
|
||||
{"pt_PT_PREEURO", "1,150$50 Esc."}
|
||||
};
|
||||
/**
|
||||
* Test localized currency patterns.
|
||||
*/
|
||||
|
@ -597,14 +608,17 @@ NumberFormatTest::TestCurrency(void)
|
|||
errln((UnicodeString)"FAIL: Expected 1,50 $");
|
||||
delete currencyFmt;
|
||||
s.truncate(0);
|
||||
currencyFmt = NumberFormat::createCurrencyInstance(Locale("de_DE_PREEURO"),status);
|
||||
char loc[256]={0};
|
||||
int len = uloc_canonicalize("de_DE_PREEURO", loc, 256, &status);
|
||||
currencyFmt = NumberFormat::createCurrencyInstance(Locale(loc),status);
|
||||
currencyFmt->format(1.50, s);
|
||||
logln((UnicodeString)"Un pauvre en Allemagne a.." + s);
|
||||
if (!(s=="1,50 DM"))
|
||||
errln((UnicodeString)"FAIL: Expected 1,50 DM");
|
||||
delete currencyFmt;
|
||||
s.truncate(0);
|
||||
currencyFmt = NumberFormat::createCurrencyInstance(Locale("fr_FR_PREEURO"), status);
|
||||
len = uloc_canonicalize("fr_FR_PREEURO", loc, 256, &status);
|
||||
currencyFmt = NumberFormat::createCurrencyInstance(Locale(loc), status);
|
||||
currencyFmt->format(1.50, s);
|
||||
logln((UnicodeString)"Un pauvre en France a....." + s);
|
||||
if (!(s=="1,50 F"))
|
||||
|
@ -612,6 +626,31 @@ NumberFormatTest::TestCurrency(void)
|
|||
delete currencyFmt;
|
||||
if (U_FAILURE(status))
|
||||
errln((UnicodeString)"FAIL: Status " + (int32_t)status);
|
||||
|
||||
for(int i=0; i < (sizeof(testCases)/sizeof(testCases[i])); i++){
|
||||
status = U_ZERO_ERROR;
|
||||
const char *localeID = testCases[i][0];
|
||||
UnicodeString expected(testCases[i][1]);
|
||||
expected = expected.unescape();
|
||||
s.truncate(0);
|
||||
char loc[256]={0};
|
||||
int len = uloc_canonicalize(localeID, loc, 256, &status);
|
||||
currencyFmt = NumberFormat::createCurrencyInstance(Locale(loc), status);
|
||||
if(U_FAILURE(status)){
|
||||
errln("Could not create currency formatter for locale %s",localeID);
|
||||
continue;
|
||||
}
|
||||
currencyFmt->format(1150.50, s);
|
||||
if(s!=expected){
|
||||
errln(UnicodeString("FAIL: Expected: ")+expected
|
||||
+ UnicodeString(" Got: ") + s
|
||||
+ UnicodeString( " for locale: ")+ UnicodeString(localeID) );
|
||||
}
|
||||
if (U_FAILURE(status)){
|
||||
errln((UnicodeString)"FAIL: Status " + (int32_t)status);
|
||||
}
|
||||
delete currencyFmt;
|
||||
}
|
||||
}
|
||||
|
||||
// -------------------------------------
|
||||
|
|
|
@ -716,8 +716,10 @@ void NumberFormatRegressionTest::Test4092480 (void)
|
|||
* interpreted as monetary separator if currency symbol is seen!
|
||||
*/
|
||||
void NumberFormatRegressionTest::Test4087244 (void) {
|
||||
Locale *de = new Locale("pt","PT_PREEURO");
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
char loc[256] = {0};
|
||||
uloc_canonicalize("pt_PT_PREEURO", loc, 256, &status);
|
||||
Locale *de = new Locale(loc);
|
||||
NumberFormat *nf = NumberFormat::createCurrencyInstance(*de, status);
|
||||
if(U_FAILURE(status)) {
|
||||
errln("Error creating DecimalFormat: %s", u_errorName(status));
|
||||
|
@ -783,7 +785,9 @@ void NumberFormatRegressionTest::Test4070798 (void)
|
|||
UnicodeString expectedPercent(chars3, 9, 9);
|
||||
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
formatter = NumberFormat::createInstance(Locale("fr_FR_PREEURO"), status);
|
||||
char loc[256]={0};
|
||||
int len = uloc_canonicalize("fr_FR_PREEURO", loc, 256, &status);
|
||||
formatter = NumberFormat::createInstance(Locale(loc), status);
|
||||
if(U_FAILURE(status)) {
|
||||
errln("Error creating DecimalFormat: %s", u_errorName(status));
|
||||
delete formatter;
|
||||
|
@ -800,8 +804,8 @@ void NumberFormatRegressionTest::Test4070798 (void)
|
|||
" Received " + tempString );
|
||||
}
|
||||
delete formatter;
|
||||
|
||||
formatter = NumberFormat::createCurrencyInstance(Locale("fr_FR_PREEURO"), status);
|
||||
len = uloc_canonicalize("fr_FR_PREEURO", loc, 256, &status);
|
||||
formatter = NumberFormat::createCurrencyInstance(loc, status);
|
||||
failure(status, "NumberFormat::createCurrencyInstance");
|
||||
tempString.remove();
|
||||
tempString = formatter->format( 5789.9876, tempString );
|
||||
|
@ -814,8 +818,9 @@ void NumberFormatRegressionTest::Test4070798 (void)
|
|||
" Received " + tempString );
|
||||
}
|
||||
delete formatter;
|
||||
|
||||
formatter = NumberFormat::createPercentInstance(Locale("fr_FR_PREEURO"), status);
|
||||
|
||||
uloc_canonicalize("fr_FR_PREEURO", loc, 256, &status);
|
||||
formatter = NumberFormat::createPercentInstance(Locale(loc), status);
|
||||
failure(status, "NumberFormat::createPercentInstance");
|
||||
tempString.remove();
|
||||
tempString = formatter->format (-5789.9876, tempString);
|
||||
|
@ -916,7 +921,9 @@ void NumberFormatRegressionTest::Test4071014 (void)
|
|||
UnicodeString expectedPercent("-578.999%");
|
||||
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
formatter = NumberFormat::createInstance(Locale("de_DE_PREEURO"), status);
|
||||
char loc[256]={0};
|
||||
int len = uloc_canonicalize("de_DE_PREEURO", loc, 256, &status);
|
||||
formatter = NumberFormat::createInstance(Locale(loc), status);
|
||||
failure(status, "NumberFormat::createNumberInstance");
|
||||
tempString.remove();
|
||||
tempString = formatter->format (-5789.9876, tempString);
|
||||
|
@ -929,8 +936,8 @@ void NumberFormatRegressionTest::Test4071014 (void)
|
|||
" Received " + tempString );
|
||||
}
|
||||
delete formatter;
|
||||
|
||||
formatter = NumberFormat::createCurrencyInstance(Locale("de_DE_PREEURO"), status);
|
||||
uloc_canonicalize("de_DE_PREEURO", loc, 256, &status);
|
||||
formatter = NumberFormat::createCurrencyInstance(Locale(loc), status);
|
||||
failure(status, "NumberFormat::createCurrencyInstance");
|
||||
tempString.remove();
|
||||
tempString = formatter->format( 5789.9876, tempString );
|
||||
|
@ -977,7 +984,9 @@ void NumberFormatRegressionTest::Test4071859 (void)
|
|||
expectedCurrency = expectedCurrency.unescape();
|
||||
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
formatter = NumberFormat::createInstance(Locale("it_IT_PREEURO"), status);
|
||||
char loc[256]={0};
|
||||
int len = uloc_canonicalize("it_IT_PREEURO", loc, 256, &status);
|
||||
formatter = NumberFormat::createInstance(Locale(loc), status);
|
||||
failure(status, "NumberFormat::createNumberInstance");
|
||||
tempString = formatter->format (-5789.9876, tempString);
|
||||
|
||||
|
@ -989,8 +998,8 @@ void NumberFormatRegressionTest::Test4071859 (void)
|
|||
" Received " + tempString );
|
||||
}
|
||||
delete formatter;
|
||||
|
||||
formatter = NumberFormat::createCurrencyInstance(Locale("it_IT_PREEURO"), status);
|
||||
uloc_canonicalize("it_IT_PREEURO", loc, 256, &status);
|
||||
formatter = NumberFormat::createCurrencyInstance(Locale(loc), status);
|
||||
failure(status, "NumberFormat::createCurrencyInstance");
|
||||
tempString.remove();
|
||||
tempString = formatter->format( -5789.9876, tempString );
|
||||
|
@ -1003,8 +1012,8 @@ void NumberFormatRegressionTest::Test4071859 (void)
|
|||
" Received " + tempString );
|
||||
}
|
||||
delete formatter;
|
||||
|
||||
formatter = NumberFormat::createPercentInstance(Locale("it_IT_PREEURO"), status);
|
||||
uloc_canonicalize("it_IT_PREEURO", loc, 256, &status);
|
||||
formatter = NumberFormat::createPercentInstance(Locale(loc), status);
|
||||
failure(status, "NumberFormat::createPercentInstance");
|
||||
tempString.remove();
|
||||
tempString = formatter->format (-5789.9876, tempString);
|
||||
|
|
|
@ -1004,7 +1004,7 @@ public:
|
|||
case 1:
|
||||
statusToCheck= U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
patternToCheck= "1:A customer in {2} is receiving a #{0} error - {1}. Their telephone call is costing {3,number,currency}."; // number,currency
|
||||
messageLocale= Locale("de","DE_PREEURO");
|
||||
messageLocale= Locale("de","DE@currency=DEM");
|
||||
countryToCheck= Locale("","BF");
|
||||
currencyToCheck= 2.32;
|
||||
expected= "1:A customer in Burkina Faso is receiving a #8 error - U_INDEX_OUTOFBOUNDS_ERROR. Their telephone call is costing 2,32 DM.";
|
||||
|
@ -1014,7 +1014,7 @@ public:
|
|||
patternToCheck= "2:user in {2} is receiving a #{0} error - {1}. "
|
||||
"They insist they just spent {3,number,currency} "
|
||||
"on memory."; // number,currency
|
||||
messageLocale= Locale("de","AT_PREEURO"); // Austrian German
|
||||
messageLocale= Locale("de","AT@currency=ATS"); // Austrian German
|
||||
countryToCheck= Locale("","US"); // hmm
|
||||
currencyToCheck= 40193.12;
|
||||
expected= CharsToUnicodeString(
|
||||
|
|
Loading…
Add table
Reference in a new issue