PRInt32 INTL_ConvertFromUnicode(const void* uniBuffer, const PRInt32 uniLength, char** aBuffer)
PRInt32 INTL_ConvertFromUnicode(const PRUnichar* uniBuffer, const PRInt32 uniLength, char** aBuffer)
PRInt32 INTL_ConvertFromUnicode(const void* uniBuffer, const PRInt32 uniLength, char** aBuffer){	nsresult res;	if (nsnull == uniBuffer) 	{		return -1;	}	NS_WITH_SERVICE(nsICharsetConverterManager, ccm, kCharsetConverterManagerCID, &res); 	if(NS_SUCCEEDED(res) && (nsnull != ccm)) 	{		nsString aCharset; aCharset.AssignWithConversion("UTF-8");		nsIUnicodeEncoder* encoder = nsnull;		// convert from unicode		res = ccm->GetUnicodeEncoder(&aCharset, &encoder);		if(NS_SUCCEEDED(res) && (nsnull != encoder)) 		{			const PRUnichar *unichars = (const PRUnichar *) uniBuffer;			PRInt32 unicharLength = uniLength;			PRInt32 dstLength;			res = encoder->GetMaxLength(unichars, unicharLength, &dstLength);			// allocale an output buffer			*aBuffer = (char *) PR_Malloc(dstLength + 1);			if (*aBuffer != nsnull) 			{				res = encoder->Convert(unichars, &unicharLength, *aBuffer, &dstLength);				(*aBuffer)[dstLength] = '\0';			}			else 			{				res = NS_ERROR_OUT_OF_MEMORY;			}			NS_IF_RELEASE(encoder);		}	}	return NS_SUCCEEDED(res) ? 0 : -1;}