> Date: Wed, 23 Dec 2015 20:19:13 +0200 > From: Eli Zaretskii <[email protected]> > Cc: [email protected] > > > > @@ -918,7 +920,13 @@ copy_converting (long n) > > > iconv_ret = iconv (iconv_to_utf8, &inptr, &bytes_left, > > > &utf8_char_ptr, &utf8_char_free); > > > /* If we managed to write a character: */ > > > - if (utf8_char_ptr > utf8_char) break; > > > + if (utf8_char_ptr > utf8_char) > > > + { > > > + if (iconv_ret == (size_t) -1) > > > + iconv_ret = iconv (iconv_to_utf8, NULL, NULL, > > > + &utf8_char_ptr, &utf8_char_free); > > > + break; > > > + } > > > } > > > > > > /* errno == E2BIG if iconv ran out of output buffer, > > > > If it's true that iconv will delay writing to the output buffer until > > it sees the next character in case it is a combining character, then > > it's possible that this condition will never be satisfied. > > No, not AFAIK. 'iconv' only returns a value different from -1 when it > finished processing all the input. By calling it with NULL arguments, > you force it to output what it's got. Which means that even a > combining character will be output -- as itself.
Ignore that, I wasn't thinking clearly. Yes, you are right, I think I should change the logic there. Will resubmit.
