From 10bb56d88175ffbc37e37615bd859ca6356c5f5d Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 25 Oct 2010 14:30:55 +0200 Subject: [PATCH] yaz-icu: avoid deprecated ICU API --- util/yaz-icu.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/util/yaz-icu.c b/util/yaz-icu.c index 10ff2fd..a8c43ce 100644 --- a/util/yaz-icu.c +++ b/util/yaz-icu.c @@ -161,25 +161,25 @@ static void print_icu_converters(const struct config_t *p_config) static void print_icu_transliterators(const struct config_t *p_config) { - int32_t buf_cap = 128; - char buf[128]; - int32_t i; - int32_t count = utrans_countAvailableIDs(); - + UErrorCode status; + UEnumeration *en = utrans_openIDs(&status); + int32_t count = uenum_count(en, &status); + const char *name; + int32_t length; + if (p_config->xmloutput) fprintf(config.outfile, "\n", count); else fprintf(config.outfile, "Available ICU transliterators: %d\n", count); - - for(i = 0; i xmloutput) - fprintf(config.outfile, "\n", buf); + fprintf(config.outfile, "\n", name); else - fprintf(config.outfile, " %s", buf); + fprintf(config.outfile, " %s", name); } - + uenum_close(en); if (p_config->xmloutput) { fprintf(config.outfile, "\n"); -- 1.7.10.4