char * p = str.ToNewCString();
char * p = ToNewCString(str);
nsresult nsCharsetConverterManager::RegisterConverterData(                                    nsIRegistry * aRegistry,                                    char * aRegistryPath){  nsresult res;  nsRegistryKey key;  nsAutoString str; str.AssignWithConversion(aRegistryPath);  str.AppendWithConversion("defaultFile");  char * p = str.ToNewCString();  res = aRegistry->AddSubtree(nsIRegistry::Common, p, &key);  nsMemory::Free(p);  if (NS_FAILED(res)) return res;  res = aRegistry->SetStringUTF8(key, "name", "resource:/res/charsetData.properties");  if (NS_FAILED(res)) return res;  return NS_OK;}