if (text->needUpdateMsgWinCharset && *text->charset) { if (!nsCRT::strcasecmp(text->charset, "us-ascii")) SetMailCharacterSetToMsgWindow(obj, NS_LITERAL_STRING("ISO-8859-1").get()); else SetMailCharacterSetToMsgWindow(obj, NS_ConvertASCIItoUCS2(text->charset).get()); } }
MimeInlineText_rotate_convert_and_parse_line(char *line, PRInt32 length,											 MimeObject *obj){  int status = 0;  MimeInlineTextClass *textc = (MimeInlineTextClass *) obj->clazz;  PR_ASSERT(!obj->closed_p);  if (obj->closed_p) return -1;  /* Rotate the line, if desired (this happens on the raw data, before any	 charset conversion.) */  if (obj->options && obj->options->rot13_p)	{	  status = textc->rot13_line(obj, line, length);	  if (status < 0) return status;	}  // Now convert to the canonical charset, if desired.  //  PRBool  doConvert = PR_TRUE;  // Don't convert vCard data  if ( ( (obj->content_type) && (!PL_strcasecmp(obj->content_type, TEXT_VCARD)) ) ||       (obj->options->format_out == nsMimeOutput::nsMimeMessageSaveAs) )    doConvert = PR_FALSE;      // Only convert if the user prefs is false   if ( (obj->options && obj->options->charset_conversion_fn) &&       (!obj->options->force_user_charset) &&       (doConvert)            )	{    MimeInlineText  *text = (MimeInlineText *) obj;    if (!text->initializeCharset)      MimeInlineText_initializeCharset(obj);    //if autodetect is on, push line to dam    if (text->inputAutodetect)    {      //see if we reach the lineDam buffer limit, if so, there is no need to keep buffering      if (text->lastLineInDam >= DAM_MAX_LINES ||          DAM_MAX_BUFFER_SIZE - text->curDamOffset <= length) {        //we let open dam process this line as well as thing that already in Dam        //In case there is nothing in dam because this line is too big, we need to         //perform autodetect on this line        status = MimeInlineText_open_dam(line, length, obj);      }      else {        //buffering current line        text->lineDamPtrs[text->lastLineInDam] = text->lineDamBuffer + text->curDamOffset;        memcpy(text->lineDamPtrs[text->lastLineInDam], line, length);        text->lastLineInDam++;        text->curDamOffset += length;      }    }    else       status = MimeInlineText_convert_and_parse_line(line, length, obj);	}  else    status = obj->clazz->parse_line(line, length, obj);  return status;}