X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=include%2Fyaz%2Fyaz-iconv.h;h=83ccfff32b7aeb236ec82988f3b01863a3d0ede0;hb=32687c1504015e0675d49983707576f8db9b7bfc;hp=599f8adf66b106c760cd93c55b9294166abea2d0;hpb=e87336d1ad9587d0a7fdc805e2b53c77d435d67c;p=yaz-moved-to-github.git diff --git a/include/yaz/yaz-iconv.h b/include/yaz/yaz-iconv.h index 599f8ad..83ccfff 100644 --- a/include/yaz/yaz-iconv.h +++ b/include/yaz/yaz-iconv.h @@ -23,7 +23,7 @@ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. * - * $Id: yaz-iconv.h,v 1.10 2006-08-04 14:35:39 adam Exp $ + * $Id: yaz-iconv.h,v 1.11 2006-08-24 10:01:03 adam Exp $ */ /** * \file yaz-iconv.h @@ -69,11 +69,31 @@ YAZ_EXPORT int yaz_matchstr(const char *s1, const char *s2); YAZ_EXPORT int yaz_strcmp_del(const char *a, const char *b, const char *b_del); +/** \brief decodes UTF-8 sequence + \param inp input buffer with UTF-8 bytes + \param inbytesleft length of input buffer + \param no_read holds number of bytes read if conversion is successful + \param error pointer to error code if error occurs + \retval 0 if error + \retval >0 if conversion is successful +*/ YAZ_EXPORT unsigned long yaz_read_UTF8_char(unsigned char *inp, size_t inbytesleft, size_t *no_read, int *error); +/** \brief encodes UTF-8 sequence + \param x the UNICODE value + \param outbuf output buffer pointer, updated if conversion is successful + \param outbytesleft length of buffer, updated if conversino is successful + \param error pointer to error code if error occurs + \retval 0 if successful + \retval -1 for error +*/ +YAZ_EXPORT size_t yaz_write_UTF8_char(unsigned long x, + char **outbuf, size_t *outbytesleft, + int *error); + YAZ_END_CDECL #endif