if (!mMappingDone) { res = CreateMapping(); if NS_FAILED(res) return res; }  return GetCharsetConverter(aSrc, (void **) aResult, &kIUnicodeDecoderIID, mDecArray, mDecSize);
res = NS_GetGlobalComponentManager(&comMgr); if(NS_FAILED(res)) return res; PRInt32 baselen = nsCRT::strlen(NS_UNICODEDECODER_PROGID_BASE); char progid[256]; PL_strncpy(progid, NS_UNICODEDECODER_PROGID_BASE, 256); aSrc->ToCString(progid + baselen, 256 - baselen); res = comMgr->CreateInstanceByProgID(progid,NULL, kIUnicodeDecoderIID,(void**)aResult); if(NS_FAILED(res)) res = NS_ERROR_UCONV_NOCONV; return res;
NS_IMETHODIMP nsCharsetConverterManager::GetUnicodeDecoder(                                         const nsString * aSrc,                                          nsIUnicodeDecoder ** aResult){  nsresult res;  if (!mMappingDone) {    res = CreateMapping();    if NS_FAILED(res) return res;  }  return GetCharsetConverter(aSrc, (void **) aResult, &kIUnicodeDecoderIID,       mDecArray, mDecSize);}