From: Adam Dickmeiss Date: Mon, 25 Oct 2010 12:30:55 +0000 (+0200) Subject: yaz-icu: avoid deprecated ICU API X-Git-Tag: v4.1.2~6 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=10bb56d88175ffbc37e37615bd859ca6356c5f5d;p=yaz-moved-to-github.git yaz-icu: avoid deprecated ICU API --- 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");