cout << "file=\"" << value << "\"" << endl;
printf("file=\"%s\"\n", value);
main(int argc, char *argv[]){  nsresult ret;  nsCOMPtr<nsIServiceManager> servMan;  NS_InitXPCOM2(getter_AddRefs(servMan), nsnull, nsnull);  nsCOMPtr<nsIComponentRegistrar> registrar = do_QueryInterface(servMan);  NS_ASSERTION(registrar, "Null nsIComponentRegistrar");  registrar->AutoRegister(nsnull);    nsCOMPtr<nsIStringBundleService> service =      do_GetService(NS_STRINGBUNDLE_CONTRACTID);  if (!service) {    printf("cannot create service\n");    return 1;  }  nsAutoString uiLang;  nsAutoString country;  ret = getUILangCountry(uiLang, country);#if DEBUG_tao  cout << "\n uiLang=" << NS_LossyConvertUTF16toASCII(uiLang).get()       << ", country=" << NS_LossyConvertUTF16toASCII(country).get()       << "\n" << endl;#endif  nsIStringBundle* bundle = nsnull;  ret = service->CreateBundle(TEST_URL, &bundle);  if (NS_FAILED(ret)) {    printf("cannot create instance\n");    return 1;  }  nsAutoString v;  PRUnichar *ptrv = nsnull;  char *value = nsnull;  // 123  ret = bundle->GetStringFromID(123, &ptrv);  if (NS_FAILED(ret)) {    printf("cannot get string from ID 123, ret=%d\n", ret);    return 1;  }  v = ptrv;  value = ToNewCString(v);  cout << "123=\"" << value << "\"" << endl;  // file  nsString strfile;  strfile.Assign(NS_LITERAL_STRING("file"));  const PRUnichar *ptrFile = strfile.get();  ret = bundle->GetStringFromName(ptrFile, &ptrv);  if (NS_FAILED(ret)) {    printf("cannot get string from name\n");    return 1;  }  v = ptrv;  value = ToNewCString(v);  cout << "file=\"" << value << "\"" << endl;  return 0;}