printf("File Name encoding = %s\n",value.ToNewCString());
printf("File Name encoding = %s\n", NS_LossyConvertUCS2toASCII(value).get());
nsresult  testPlatformCharset(){  nsIPlatformCharset * cinfo;  nsresult res = nsServiceManager::GetService(kPlatformCharsetCID,      NS_GET_IID(nsIPlatformCharset), (nsISupports **)&cinfo);  if (NS_FAILED(res)) {    printf("ERROR at GetService() code=0x%x.\n",res);    return res;  }  nsString value;  res = cinfo->GetCharset(kPlatformCharsetSel_PlainTextInClipboard , value);  printf("Clipboard plain text encoding = %s\n",value.ToNewCString());    res = cinfo->GetCharset(kPlatformCharsetSel_FileName , value);  printf("File Name encoding = %s\n",value.ToNewCString());  res = cinfo->GetCharset(kPlatformCharsetSel_Menu , value);  printf("Menu encoding = %s\n",value.ToNewCString());  cinfo->Release();  return res;  }