else if (aCharset.IsEmpty() || Compare(aCharset, NS_LITERAL_STRING("us-ascii"), nsCaseInsensitiveStringComparator()) == 0 || Compare(aCharset, NS_LITERAL_STRING("ISO-8859-1"), nsCaseInsensitiveStringComparator()) == 0) {
else if (!*aCharset || !nsCRT::strcasecmp("us-ascii", aCharset) || !nsCRT::strcasecmp("ISO-8859-1", aCharset)) {
nsresult ConvertToUnicode(const nsAString& aCharset,                           const char* inCString,                           nsString& outString){#if 0   nsresult rv;  rv = nsMsgI18NConvertToUnicode(aCharset, nsCAutoString(inCString), outString);  return rv;#endif  if (NULL == inCString) {    return NS_ERROR_NULL_POINTER;  }  else if ('\0' == *inCString) {    outString.Truncate();    return NS_OK;  }  else if (aCharset.IsEmpty() ||           Compare(aCharset,                   NS_LITERAL_STRING("us-ascii"),                   nsCaseInsensitiveStringComparator()) == 0 ||           Compare(aCharset,                   NS_LITERAL_STRING("ISO-8859-1"),                   nsCaseInsensitiveStringComparator()) == 0) {    outString.AssignWithConversion(inCString);    return NS_OK;  }  nsresult res;  nsCOMPtr <nsICharsetConverterManager2> ccm2 = do_GetService(NS_CHARSETCONVERTERMANAGER_CONTRACTID, &res);  NS_ENSURE_SUCCESS(res, res);  nsCOMPtr <nsIAtom> charsetAtom;  res = ccm2->GetCharsetAtom(PromiseFlatString(aCharset).get(),                             getter_AddRefs(charsetAtom));  NS_ENSURE_SUCCESS(res, res);  // get an unicode converter  nsCOMPtr<nsIUnicodeDecoder> decoder;  res = ccm2->GetUnicodeDecoder(charsetAtom, getter_AddRefs(decoder));  NS_ENSURE_SUCCESS(res, res);  PRUnichar *unichars;  PRInt32 unicharLength;  PRInt32 srcLen = PL_strlen(inCString);  // buffer size 144 =  // 72 (default line len for compose)   // times 2 (converted byte len might be larger)  const int klocalbufsize = 144;   PRUnichar localbuf[klocalbufsize+1];  PRBool usedlocalbuf;  if (srcLen > klocalbufsize) {    res = decoder->GetMaxLength(inCString, srcLen, &unicharLength);    NS_ENSURE_SUCCESS(res, res);    unichars = (PRUnichar *) nsMemory::Alloc(unicharLength * sizeof(PRUnichar));    NS_ENSURE_TRUE(unichars, NS_ERROR_OUT_OF_MEMORY);    usedlocalbuf = PR_FALSE;  }  else {    unichars = localbuf;    unicharLength = klocalbufsize+1;    usedlocalbuf = PR_TRUE;  }  // convert to unicode  res = decoder->Convert(inCString, &srcLen, unichars, &unicharLength);  outString.Assign(unichars, unicharLength);  if (!usedlocalbuf)    nsMemory::Free(unichars);  return res;}