int len = *aResultLength; *aResultLength = 0;   int nb = WideCharToMultiByte(mCodePage, 0, aString, aLength, *aResult, 0, nsnull, nsnull); if (!nb) return; if (nb > len) {  *aResult = new char[nb]; if (!*aResult) return;
nsAutoChar16Buffer buffer; nsresult rv = SubstituteChars(PR_FALSE, aString, aLength, buffer, &aLength); if (NS_FAILED(rv)) {  *aResultLength = 0; return;
nsFontSubset::Convert(const PRUnichar* aString, PRUint32 aLength,  char** aResult /*IN/OUT*/, int* aResultLength /*IN/OUT*/){  int len = *aResultLength; // current available len of aResult  *aResultLength = 0;  // Get the number of bytes needed for the conversion  int nb = WideCharToMultiByte(mCodePage, 0, aString, aLength,                               *aResult, 0, nsnull, nsnull);  if (!nb) return;  if (nb > len) {    // Allocate a bigger array that the caller should free    *aResult = new char[nb];    if (!*aResult) return;  }  // Convert the Unicode string to ANSI  *aResultLength = WideCharToMultiByte(mCodePage, 0, aString, aLength,                                       *aResult, nb, nsnull, nsnull);}