Skip to content

Commit 0db7ebe

Browse files
srl295BridgeAR
authored andcommitted
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: #29523 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Jiawen Geng <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ujjwal Sharma <[email protected]>
1 parent 9abee07 commit 0db7ebe

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

tools/icu/iculslocs.cc

+11-2
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,8 @@ int dumpAllButInstalledLocales(int lev,
209209
} else {
210210
printIndent(bf, lev);
211211
fprintf(bf, "%s", key);
212-
switch (ures_getType(t.getAlias())) {
212+
const UResType type = ures_getType(t.getAlias());
213+
switch (type) {
213214
case URES_STRING: {
214215
int32_t len = 0;
215216
const UChar* s = ures_getString(t.getAlias(), &len, status);
@@ -218,8 +219,16 @@ int dumpAllButInstalledLocales(int lev,
218219
fwrite(s, len, 1, bf);
219220
fprintf(bf, "\"}");
220221
} break;
222+
case URES_TABLE: {
223+
fprintf(bf, ":table {\n");
224+
dumpAllButInstalledLocales(lev+1, &t, bf, status);
225+
printIndent(bf, lev);
226+
fprintf(bf, "}\n");
227+
} break;
221228
default: {
222-
printf("ERROR: unhandled type in dumpAllButInstalledLocales().\n");
229+
printf("ERROR: unhandled type %d for key %s "
230+
"in dumpAllButInstalledLocales().\n",
231+
static_cast<int>(type), key);
223232
return 1;
224233
} break;
225234
}

0 commit comments

Comments
 (0)