+ /* Try to convert some more */
+ fc->p = fc->ob = fc->bufo;
+ if (fc->ibl) {
+ ssize_t obl = ssizeof(fc->bufo);
+
+ my_iconv(fc->cd, (const char **)&fc->ib, &fc->ibl, &fc->ob, &obl);
+ if (fc->p < fc->ob)
+ return (unsigned char)*(fc->p)++;
+ }
+
+ /* If we trusted iconv a bit more, we would at this point
+ * ask why it had stopped converting ... */
+
+ /* Try to read some more */
+ if (fc->ibl == sizeof(fc->bufi)
+ || (fc->ibl && fc->ib + fc->ibl < fc->bufi + sizeof(fc->bufi))) {
+ fc->p = NULL;
+ return EOF;
+ }
+
+ if (fc->ibl) {
+ memcpy(fc->bufi, fc->ib, fc->ibl);
+ }
+ fc->ib = fc->bufi;
+ fc->ibl += fread(fc->ib + fc->ibl, 1, sizeof(fc->bufi) - fc->ibl,
+ fc->file);
+
+ /* Try harder this time to convert some */
+ if (fc->ibl) {
+ ssize_t obl = ssizeof(fc->bufo);
+
+ mutt_iconv(fc->cd, (const char **)&fc->ib, &fc->ibl, &fc->ob, &obl,
+ fc->inrepls, 0);
+ if (fc->p < fc->ob) {
+ return (unsigned char)*(fc->p)++;
+ }
+ }
+
+ /* Either the file has finished or one of the buffers is too small */
+ fc->p = NULL;
+ return EOF;