char *outptr;
size_t nconv;
- if (utf8_to_locale == (iconv_t) -1 && (open_conversion_contexts() == -1))
+ if (utf8_to_locale == (iconv_t) -1 && (open_conversion_contexts() == -1)) {
+ if (conv_fails != NULL) *conv_fails = insize;
return NULL;
+ }
assert(utf8_to_locale != (iconv_t) -1);
/* make sure we start from an empty state */
iconv(utf8_to_locale, NULL, NULL, NULL, NULL);
else {
/* EINVAL should not happen, since we convert entire strings */
/* EBADF is an error which should be captured by the assert above */
+ if (conv_fails != NULL) *conv_fails += insize;
return NULL;
}
nconv = iconv(utf8_to_locale, &inptr, &insize, &outptr, &outsize);