printf("DefaultCharset for %s is %s\n",categoryAsNSString.ToNewCString(),charsetAsNSString.ToNewCString());
printf("DefaultCharset for %s is %s\n", NS_LossyConvertUCS2toASCII(categoryAsNSString).get(), NS_LossyConvertUCS2toASCII(charsetAsNSString).get());
main(int argc, const char** argv){	nsCOMPtr<nsILocaleService>		locale_service;	nsCOMPtr<nsILocale>				locale;	nsCOMPtr<nsIPlatformCharset>	platform_charset;	nsString						locale_category; locale_category.AssignWithConversion("NSILOCALE_MESSAGES");	PRUnichar*						category_value, *charset;	nsString						categoryAsNSString, charsetAsNSString;	nsresult rv = nsComponentManager::CreateInstance(NS_PLATFORMCHARSET_CONTRACTID,NULL,kPlatformCharsetIID,getter_AddRefs(platform_charset));	rv = nsComponentManager::CreateInstance(kLocaleServiceCID,NULL,kLocaleServiceIID,getter_AddRefs(locale_service));	if (NS_FAILED(rv)) return -1;	rv = locale_service->GetSystemLocale(getter_AddRefs(locale));	if (NS_FAILED(rv)) return -1;	rv = locale->GetCategory(locale_category.get(),&category_value);	if (NS_FAILED(rv)) return -1;	rv = platform_charset->GetDefaultCharsetForLocale(category_value,&charset);	if (NS_FAILED(rv)) return -1;	charsetAsNSString = charset;	categoryAsNSString = category_value;	printf("DefaultCharset for %s is %s\n",categoryAsNSString.ToNewCString(),charsetAsNSString.ToNewCString());	categoryAsNSString.AssignWithConversion("en-US");	rv = platform_charset->GetDefaultCharsetForLocale(categoryAsNSString.get(),&charset);	if (NS_FAILED(rv)) return -1;	charsetAsNSString = charset;	printf("DefaultCharset for %s is %s\n",categoryAsNSString.ToNewCString(),charsetAsNSString.ToNewCString());	return 0;}