mirror of https://github.com/nodejs/node.git
tools: fix iculslocs to support ICU 65.1
The ICU alias table format changed in https://unicode-org.atlassian.net/browse/ICU-20627 Because of this, iculslocs.cc needs to handle URES_TABLE format contents in the res_index.txt file. PR-URL: https://github.com/nodejs/node/pull/29523 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>pull/29523/head
parent
f62e7a9388
commit
fa6839ecaa
|
@ -209,7 +209,8 @@ int dumpAllButInstalledLocales(int lev,
|
||||||
} else {
|
} else {
|
||||||
printIndent(bf, lev);
|
printIndent(bf, lev);
|
||||||
fprintf(bf, "%s", key);
|
fprintf(bf, "%s", key);
|
||||||
switch (ures_getType(t.getAlias())) {
|
const UResType type = ures_getType(t.getAlias());
|
||||||
|
switch (type) {
|
||||||
case URES_STRING: {
|
case URES_STRING: {
|
||||||
int32_t len = 0;
|
int32_t len = 0;
|
||||||
const UChar* s = ures_getString(t.getAlias(), &len, status);
|
const UChar* s = ures_getString(t.getAlias(), &len, status);
|
||||||
|
@ -218,8 +219,16 @@ int dumpAllButInstalledLocales(int lev,
|
||||||
fwrite(s, len, 1, bf);
|
fwrite(s, len, 1, bf);
|
||||||
fprintf(bf, "\"}");
|
fprintf(bf, "\"}");
|
||||||
} break;
|
} break;
|
||||||
|
case URES_TABLE: {
|
||||||
|
fprintf(bf, ":table {\n");
|
||||||
|
dumpAllButInstalledLocales(lev+1, &t, bf, status);
|
||||||
|
printIndent(bf, lev);
|
||||||
|
fprintf(bf, "}\n");
|
||||||
|
} break;
|
||||||
default: {
|
default: {
|
||||||
printf("ERROR: unhandled type in dumpAllButInstalledLocales().\n");
|
printf("ERROR: unhandled type %d for key %s "
|
||||||
|
"in dumpAllButInstalledLocales().\n",
|
||||||
|
static_cast<int>(type), key);
|
||||||
return 1;
|
return 1;
|
||||||
} break;
|
} break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue