if (PR_TRUE == setCharset) { rv = SetCharset(str); }
NS_IMETHODIMP CSSLoaderImpl::SetCharset(/*in*/ const nsString &aCharsetSrc)  // public methods for clients to set the charset if they know it  //  NOTE: the SetCharset method will always get the preferred charset from the charset passed in  //        unless it is the emptystring, which causes the default charset to be set{  nsresult rv = NS_OK;  if (aCharsetSrc.Length() == 0) {    mCharset.AssignWithConversion("ISO-8859-1");  } else {    NS_WITH_SERVICE(nsICharsetAlias, calias, kCharsetAliasCID, &rv);    NS_ASSERTION(calias, "cannot find charset alias");    nsAutoString charsetName(aCharsetSrc);    if( NS_SUCCEEDED(rv) && (nsnull != calias))    {      PRBool same = PR_FALSE;      rv = calias->Equals(aCharsetSrc, mCharset, &same);      if(NS_SUCCEEDED(rv) && same)      {        return NS_OK; // no difference, don't change it      }      // different, need to change it      rv = calias->GetPreferred(aCharsetSrc, charsetName);      if(NS_FAILED(rv))      {         // failed - unknown alias , fallback to ISO-8859-1        charsetName.AssignWithConversion("ISO-8859-1");      }      mCharset = charsetName;    }  }  return rv;}