nsCOMPtr <nsIPlatformCharset> platformCharset; nsresult rv = nsComponentManager::CreateInstance(NS_PLATFORMCHARSET_PROGID, nsnull, NS_GET_IID(nsIPlatformCharset), getter_AddRefs(platformCharset));
nsresult rv; nsCOMPtr <nsIPlatformCharset> platformCharset = do_GetService(NS_PLATFORMCHARSET_PROGID, &rv);
const nsString& msgCompFileSystemCharset(){	/* Get a charset used for the file. */	static nsString aPlatformCharset;	if (aPlatformCharset.Length() < 1) 	{		nsCOMPtr <nsIPlatformCharset> platformCharset;		nsresult rv = nsComponentManager::CreateInstance(NS_PLATFORMCHARSET_PROGID, nsnull, 	                             NS_GET_IID(nsIPlatformCharset), getter_AddRefs(platformCharset));		if (NS_SUCCEEDED(rv)) 			rv = platformCharset->GetCharset(kPlatformCharsetSel_FileName, aPlatformCharset);		if (NS_FAILED(rv)) 			aPlatformCharset.Assign("ISO-8859-1");	}	return aPlatformCharset;}