while((ch = fgetc(fin)) != EOF)
while ((ch = fgetconv (fc)) != EOF)
static void encode_base64 (FILE * fin, FILE *fout, int istext, CHARSET_MAP *map){  int ch, ch1 = EOF;    b64_num = b64_linelen = 0;    while((ch = fgetc(fin)) != EOF)  {    if(istext && map)      ch = mutt_display_char(ch, map);    if(istext && ch == '\n' && ch1 != '\r')      b64_putc('\r', fout);    b64_putc(ch, fout);    ch1 = ch;  }  b64_flush(fout);  fputc('\n', fout);}