PRInt32 len = strlen(unescaped);
PRInt32 len = nsCRT::strlen(unescaped);
NS_IMETHODIMP  nsTextToSubURI::UnEscapeAndConvert(  const char *charset, const char *text, PRUnichar **_retval) {  if(nsnull == _retval)    return NS_ERROR_NULL_POINTER;  *_retval = nsnull;  nsresult rv = NS_OK;    // unescape the string, unescape changes the input  char *unescaped = nsCRT::strdup((char *) text);  if (nsnull == unescaped)    return NS_ERROR_OUT_OF_MEMORY;  unescaped = nsUnescape(unescaped);  NS_ASSERTION(unescaped, "nsUnescape returned null");  // Convert from the charset to unicode  nsCOMPtr<nsICharsetConverterManager> ccm =            do_GetService(kCharsetConverterManagerCID, &rv);   if (NS_SUCCEEDED(rv)) {    nsAutoString charsetStr; charsetStr.AssignWithConversion(charset);    nsIUnicodeDecoder *decoder;    rv = ccm->GetUnicodeDecoder(&charsetStr, &decoder);    if (NS_SUCCEEDED(rv)) {      PRUnichar *pBuf = nsnull;      PRInt32 len = strlen(unescaped);      PRInt32 outlen = 0;      if (NS_SUCCEEDED(rv = decoder->GetMaxLength(unescaped, len, &outlen))) {        pBuf = (PRUnichar *) PR_Malloc((outlen+1)*sizeof(PRUnichar*));        if (nsnull == pBuf)          rv = NS_ERROR_OUT_OF_MEMORY;        else {          if (NS_SUCCEEDED(rv = decoder->Convert(unescaped, &len, pBuf, &outlen))) {            pBuf[outlen] = 0;            *_retval = pBuf;          }        }      }      NS_IF_RELEASE(decoder);    }  }  PR_FREEIF(unescaped);  return rv;}