result = nsComponentManager::FindFactory(kLocaleFactoryCID, getter_AddRefs(localeFactory));
localeFactory = do_GetClassObject(kLocaleFactoryCID, &result);
factory_get_locale(void){	nsresult			result;	nsCOMPtr<nsILocaleFactory>	localeFactory;	nsCOMPtr<nsILocale>	locale;	nsString*			category;	nsString*			value;	const char*			acceptLangString = "ja;q=0.9,en;q=1.0,*";	PRUnichar *lc_name_unichar;	result = nsComponentManager::FindFactory(kLocaleFactoryCID,										getter_AddRefs(localeFactory));	NS_ASSERTION(NS_SUCCEEDED(result),"nsLocaleTest: factory_create_interface failed");	//	// get the application locale	//	result = localeFactory->GetApplicationLocale(getter_AddRefs(locale));	NS_ASSERTION(NS_SUCCEEDED(result),"nsLocaleTest: factory_get_locale failed");	//	// test and make sure the locale is a valid Interface	//	locale->AddRef();	category = new nsString("NSILOCALE_CTYPE");	value = new nsString();	result = locale->GetCategory(category, &lc_name_unichar);	NS_ASSERTION(NS_SUCCEEDED(result),"nsLocaleTest: factory_get_locale failed");  value->SetString(lc_name_unichar);	delete category;	delete value;	//	// test GetSystemLocale	//	result = localeFactory->GetSystemLocale(getter_AddRefs(locale));	NS_ASSERTION(NS_SUCCEEDED(result),"nsLocaleTest: factory_get_locale failed");	NS_ASSERTION(locale!=NULL,"nsLocaleTest: factory_get_locale failed");	//	// test and make sure the locale is a valid Interface	//	category = new nsString("NSILOCALE_CTYPE");	value = new nsString();	result = locale->GetCategory(category->get(),&lc_name_unichar);	NS_ASSERTION(NS_SUCCEEDED(result),"nsLocaleTest: factory_get_locale failed");  value->SetString(lc_name_unichar);	delete category;	delete value;	//	// test GetLocaleFromAcceptLanguage	//	result = localeFactory->GetLocaleFromAcceptLanguage(acceptLangString,getter_AddRefs(locale));	NS_ASSERTION(NS_SUCCEEDED(result),"nsLocaleTest: factory_get_locale failed");	//	// test and make sure the locale is a valid Interface	//	category = new nsString("NSILOCALE_CTYPE");	value = new nsString();	result = locale->GetCategory(category, &lc_name_unichar);	NS_ASSERTION(NS_SUCCEEDED(result),"nsLocaleTest: factory_get_locale failed");  value->SetString(lc_name_unichar);	delete category;	delete value;}