/* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2011 Index Data
+ * Copyright (C) 1995-2012 Index Data
* See the file LICENSE for details.
*/
/**
}
else
*error = YAZ_ICONV_EILSEQ;
- }
+ }
else if (inp[0] <= 0xf7 && inbytesleft >= 4)
{
if ((inp[1] & 0xc0) == 0x80 && (inp[2] & 0xc0) == 0x80
{
*outp++ = (unsigned char) x;
(*outbytesleft)--;
- }
+ }
else if (x <= 0x7ff && *outbytesleft >= 2)
{
*outp++ = (unsigned char) ((x >> 6) | 0xc0);
*outp++ = (unsigned char) ((x & 0x3f) | 0x80);
(*outbytesleft) -= 6;
}
- else
+ else
{
*error = YAZ_ICONV_E2BIG; /* not room for output */
return (size_t)(-1);
yaz_iconv_encoder_t yaz_utf8_encoder(const char *tocode,
yaz_iconv_encoder_t e)
-
+
{
if (!yaz_matchstr(tocode, "UTF8"))
{
inbytesleft -= no_read;
}
return 1;
-}
+}
/*
* Local variables: