From 2f577ad544711be46b63dd24fde4564d6e55d90d Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 27 Nov 2009 22:21:29 +0100 Subject: [PATCH] Remove unused function icu_utf16_from_utf8 --- include/yaz/icu_I18N.h | 4 ---- src/icu_I18N.c | 32 -------------------------------- 2 files changed, 36 deletions(-) diff --git a/include/yaz/icu_I18N.h b/include/yaz/icu_I18N.h index 457f767..ef3c13d 100644 --- a/include/yaz/icu_I18N.h +++ b/include/yaz/icu_I18N.h @@ -88,10 +88,6 @@ struct icu_buf_utf8 * icu_buf_utf8_resize(struct icu_buf_utf8 * buf8, void icu_buf_utf8_destroy(struct icu_buf_utf8 * buf8); -UErrorCode icu_utf16_from_utf8(struct icu_buf_utf16 * dest16, - struct icu_buf_utf8 * src8, - UErrorCode * status); - UErrorCode icu_utf16_from_utf8_cstr(struct icu_buf_utf16 * dest16, const char * src8cstr, UErrorCode * status); diff --git a/src/icu_I18N.c b/src/icu_I18N.c index 9f1d13c..85b035b 100644 --- a/src/icu_I18N.c +++ b/src/icu_I18N.c @@ -205,38 +205,6 @@ void icu_buf_utf8_destroy(struct icu_buf_utf8 * buf8) } - -UErrorCode icu_utf16_from_utf8(struct icu_buf_utf16 * dest16, - struct icu_buf_utf8 * src8, - UErrorCode * status) -{ - int32_t utf16_len = 0; - - u_strFromUTF8(dest16->utf16, dest16->utf16_cap, - &utf16_len, - (const char *) src8->utf8, src8->utf8_len, status); - - /* check for buffer overflow, resize and retry */ - if (*status == U_BUFFER_OVERFLOW_ERROR) - { - icu_buf_utf16_resize(dest16, utf16_len * 2); - *status = U_ZERO_ERROR; - u_strFromUTF8(dest16->utf16, dest16->utf16_cap, - &utf16_len, - (const char *) src8->utf8, src8->utf8_len, status); - } - - if (U_SUCCESS(*status) - && utf16_len <= dest16->utf16_cap) - dest16->utf16_len = utf16_len; - else - icu_buf_utf16_clear(dest16); - - return *status; -} - - - UErrorCode icu_utf16_from_utf8_cstr(struct icu_buf_utf16 * dest16, const char * src8cstr, UErrorCode * status) -- 1.7.10.4