res = encoder->Convert(unicodeStr.GetUnicode(), &unicharLength, dstPtr, &dstLength);
res = encoder->Convert(unicodeStr.get(), &unicharLength, dstPtr, &dstLength);
CreateUtf7ConvertedStringFromUnicode(const PRUnichar * aSourceString){  nsresult res;  char *dstPtr = nsnull;  PRInt32 dstLength = 0;    NS_WITH_SERVICE(nsICharsetConverterManager, ccm, kCharsetConverterManagerCID, &res);   if(NS_SUCCEEDED(res) && (nsnull != ccm))  {    nsString aCharset; aCharset.AssignWithConversion("x-imap4-modified-utf7");    PRInt32 unicharLength;      // convert from 8 bit ascii string to modified utf7      nsString unicodeStr(aSourceString);      nsIUnicodeEncoder* encoder = nsnull;      aCharset.AssignWithConversion("x-imap4-modified-utf7");      res = ccm->GetUnicodeEncoder(&aCharset, &encoder);      if(NS_SUCCEEDED(res) && (nsnull != encoder))       {        res = encoder->GetMaxLength(unicodeStr.GetUnicode(), unicodeStr.Length(), &dstLength);        // allocale an output buffer        dstPtr = (char *) PR_CALLOC(dstLength + 1);        unicharLength = unicodeStr.Length();        if (dstPtr == nsnull)         {          res = NS_ERROR_OUT_OF_MEMORY;        }        else         {			// this should be enough of a finish buffer - utf7 isn't changing, and it'll always be '-'		  char finishBuffer[20];		  PRInt32 finishSize = sizeof(finishBuffer);          res = encoder->Convert(unicodeStr.GetUnicode(), &unicharLength, dstPtr, &dstLength);		  encoder->Finish(finishBuffer, &finishSize);		  finishBuffer[finishSize] = '\0';          dstPtr[dstLength] = 0;		  strcat(dstPtr, finishBuffer);        }      }      NS_IF_RELEASE(encoder);        }    return dstPtr;}