/* Copyright (c) 2014-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "mempool.h"
#include "array.h"
#include "str.h"
#include "unichar.h"
#include "fts-icu.h"
#include <unicode/ucasemap.h>
{
return icu_csm;
i_fatal("LibICU ucasemap_open() failed: %s",
u_errorName(err));
}
return icu_csm;
}
const char *src_utf8)
{
/* try to encode with the current buffer size */
if (err == U_BUFFER_OVERFLOW_ERROR) {
/* try again with a larger buffer */
err = U_ZERO_ERROR;
}
i_panic("LibICU u_strFromUTF8Lenient() failed: %s",
u_errorName(err));
}
}
unsigned int src_len)
{
/* try to encode with the current buffer size */
if (err == U_BUFFER_OVERFLOW_ERROR) {
/* try again with a larger buffer */
err = U_ZERO_ERROR;
}
i_panic("LibICU u_strToUTF8WithSub() failed: %s",
u_errorName(err));
}
}
const char **error_r)
{
/* translation is done in-place in the buffer. try first with the
current buffer size. */
if (err == U_BUFFER_OVERFLOW_ERROR) {
/* try again with a larger buffer */
err = U_ZERO_ERROR;
avail_uchars * sizeof(UChar));
}
u_errorName(err));
return -1;
}
return 0;
}
{
char *dest_data;
int dest_full_len;
/* ucasemap_utf8ToLower() may need to be called multiple times, because
the first return value may not be large enough. */
for (unsigned int i = 0;; i++) {
break;
err = U_ZERO_ERROR;
}
i_fatal("LibICU ucasemap_utf8ToLower() failed: %s",
u_errorName(err));
}
}
void fts_icu_deinit(void)
{
}
u_cleanup();
}
const char **error_r)
{
/* we have only one line in our ID */
}
return -1;
}
return 0;
}