char * cryptCString = crypt.ToNewCString();
char * cryptCString = ToNewCString(crypt);
Wallet_Decrypt(const nsString& crypt, nsString& text) {  /* decrypt crypt to text */  char * cryptCString = crypt.ToNewCString();  char * UTF8textCString = nsnull;  nsresult rv = DecryptString(cryptCString, UTF8textCString);  Recycle(cryptCString);  if NS_FAILED(rv) {    return rv;  }  /* convert text from UTF8 to unichar */  PRUnichar c1, c2, c3;  text.Truncate(0);  text.SetCapacity(2 * crypt.Length());    PRUint32 UTF8textCString_len = PL_strlen(UTF8textCString);  for (PRUint32 i=0; i<UTF8textCString_len; ) {    c1 = (PRUnichar)UTF8textCString[i++];        if ((c1 & 0x80) == 0x00) {      text += c1;    } else if ((c1 & 0xE0) == 0xC0) {      c2 = (PRUnichar)UTF8textCString[i++];          text += (PRUnichar)(((c1 & 0x1F)<<6) + (c2 & 0x3F));    } else if ((c1 & 0xF0) == 0xE0) {      c2 = (PRUnichar)UTF8textCString[i++];          c3 = (PRUnichar)UTF8textCString[i++];          text += (PRUnichar)(((c1 & 0x0F)<<12) + ((c2 & 0x3F)<<6) + (c3 & 0x3F));    } else {      Recycle(UTF8textCString);      return NS_ERROR_FAILURE; /* this is an error, input was not utf8 */    }  }  Recycle(UTF8textCString);  return NS_OK;}