From fa6839ecaafc6f499106678fc5118cba9ca06df7 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Tue, 10 Sep 2019 14:18:17 -0700 Subject: 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 Reviewed-By: Richard Lau Reviewed-By: James M Snell Reviewed-By: Michael Dawson Reviewed-By: Jiawen Geng Reviewed-By: Anna Henningsen Reviewed-By: Ujjwal Sharma --- tools/icu/iculslocs.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'tools/icu') diff --git a/tools/icu/iculslocs.cc b/tools/icu/iculslocs.cc index 8b1fa527c2..e0de237745 100644 --- a/tools/icu/iculslocs.cc +++ b/tools/icu/iculslocs.cc @@ -209,7 +209,8 @@ int dumpAllButInstalledLocales(int lev, } else { printIndent(bf, lev); fprintf(bf, "%s", key); - switch (ures_getType(t.getAlias())) { + const UResType type = ures_getType(t.getAlias()); + switch (type) { case URES_STRING: { int32_t len = 0; const UChar* s = ures_getString(t.getAlias(), &len, status); @@ -218,8 +219,16 @@ int dumpAllButInstalledLocales(int lev, fwrite(s, len, 1, bf); fprintf(bf, "\"}"); } break; + case URES_TABLE: { + fprintf(bf, ":table {\n"); + dumpAllButInstalledLocales(lev+1, &t, bf, status); + printIndent(bf, lev); + fprintf(bf, "}\n"); + } break; default: { - printf("ERROR: unhandled type in dumpAllButInstalledLocales().\n"); + printf("ERROR: unhandled type %d for key %s " + "in dumpAllButInstalledLocales().\n", + static_cast(type), key); return 1; } break; } -- cgit v1.2.3