char * value = NULL; res = aPref->CopyCharPref(aKey, &value);
nsCOMPtr<nsIPrefLocalizedString> pls; res = mPrefs->GetComplexValue(aKey, NS_GET_IID(nsIPrefLocalizedString), getter_AddRefs(pls));
nsresult nsCharsetMenu::AddFromPrefsToMenu(nsIPref * aPref,                                            nsIRDFService * aRDFServ,                                            nsICharsetConverterManager * aCCMan,                                            nsObjectArray * aObjectArray,                                            nsIRDFContainer * aContainer,                                            char * aKey){  nsresult res = NS_OK;  char * value = NULL;  res = aPref->CopyCharPref(aKey, &value);  if (NS_FAILED(res)) return res;  if (value != NULL) {    char * p = value;    char * q = p;    while (*p != 0) {      for (; (*q != ',') && (*q != ' ') && (*q != 0); q++);      char temp = *q;      *q = 0;      nsAutoString str(p);      AddItemToMenu(aRDFServ, aCCMan, aObjectArray, aContainer, &str);      *q = temp;      for (; (*q == ',') || (*q == ' '); q++);      p=q;    }    nsAllocator::Free(value);  }  return res;}