char* cstr = left.ToNewUTF8String();
char* cstr = ToNewUTF8String(left);
Compare(nsString& str, nsString& aFileName){  // Open the file in a Unix-centric way,  // until I find out how to use nsFileSpec:  char* filename = aFileName.ToNewCString();  FILE* file = fopen(filename, "r");  if (!file)  {    fprintf(stderr, "Can't open file %s", filename);    perror(" ");    delete[] filename;    return 2;  }  delete[] filename;  // Inefficiently read from the file:  nsString inString;  int c;  int index = 0;  int different = 0;  while ((c = getc(file)) != EOF)  {    inString.AppendWithConversion((char)c);    // CVS isn't doing newline comparisons on these files for some reason.    // So compensate for possible newline problems in the CVS file:    if (c == '\n' && str[index] == '\r')      ++index;    if (c != str[index++])    {      //printf("Comparison failed at char %d: generated was %d, file had %d\n",      //       index, (int)str[index-1], (int)c);      different = index;      break;    }  }  if (file != stdin)    fclose(file);  if (!different)    return 0;  else  {    nsAutoString left;    str.Left(left, different);    char* cstr = left.ToNewUTF8String();    printf("Comparison failed at char %d:\n-----\n%s\n-----\n",           different, cstr);    Recycle(cstr);    return 1;  }}