while ((c = fgetc (fin)) != EOF)
while ((c = fgetconv (fc)) != EOF)
static void encode_quoted (FILE * fin, FILE *fout, int istext, CHARSET_MAP *map){  int c, linelen = 0;  char line[77], savechar;  while ((c = fgetc (fin)) != EOF)  {    if(istext && map)      c = mutt_display_char(c, map);    /* Escape lines that begin with "the message separator". */    if (linelen == 5 && !mutt_strncmp ("From ", line, 5))    {      strfcpy (line, "=46rom ", sizeof (line));      linelen = 7;    }    else if (linelen == 1 && line[0] == '.')    {      strfcpy (line, "=2E", sizeof (line));      linelen = 3;    }    /* Wrap the line if needed. */    if (linelen == 76 && ((istext && c != '\n') || !istext))    {      /* If the last character is "quoted", then be sure to move all three       * characters to the next line.  Otherwise, just move the last       * character...       */      if (line[linelen-3] == '=')      {        line[linelen-3] = 0;        fputs (line, fout);              fputs ("=\n", fout);        line[linelen] = 0;        line[0] = '=';        line[1] = line[linelen-2];        line[2] = line[linelen-1];        linelen = 3;      }      else      {        savechar = line[linelen-1];        line[linelen-1] = '=';        line[linelen] = 0;        fputs (line, fout);        fputc ('\n', fout);        line[0] = savechar;        linelen = 1;      }    }    if (c == '\n' && istext)    {      /* Check to make sure there is no trailing space on this line. */      if (linelen > 0 && (line[linelen-1] == ' ' || line[linelen-1] == '\t'))      {        if (linelen < 74)	{          sprintf (line+linelen-1, "=%2.2X", (unsigned char) line[linelen-1]);          fputs (line, fout);        }        else	{          int savechar = line[linelen-1];          line[linelen-1] = '=';          line[linelen] = 0;          fputs (line, fout);          fprintf (fout, "\n=%2.2X", (unsigned char) savechar);        }      }      else      {        line[linelen] = 0;        fputs (line, fout);      }      fputc ('\n', fout);      linelen = 0;    }    else if (c != 9 && (c < 32 || c > 126 || c == '='))    {      /* Check to make sure there is enough room for the quoted character.       * If not, wrap to the next line.       */      if (linelen > 73)      {        line[linelen++] = '=';        line[linelen] = 0;        fputs (line, fout);        fputc ('\n', fout);        linelen = 0;      }      sprintf (line+linelen,"=%2.2X", (unsigned char) c);      linelen += 3;    }    else    {      /* Don't worry about wrapping the line here.  That will happen during       * the next iteration when I'll also know what the next character is.       */      line[linelen++] = c;    }  }  /* Take care of anything left in the buffer */  if (linelen > 0)  {    if (line[linelen-1] == ' ' || line[linelen-1] == '\t')    {      /* take care of trailing whitespace */      if (linelen < 74)        sprintf (line+linelen-1, "=%2.2X", (unsigned char) line[linelen-1]);      else      {        savechar = line[linelen-1];        line[linelen-1] = '=';        line[linelen] = 0;        fputs (line, fout);        fputc ('\n', fout);        sprintf (line, "=%2.2X", (unsigned char) savechar);      }    }    else      line[linelen] = 0;    fputs (line, fout);  }}