rv = aUnicodeDecoder->Convert(aANSIString, &numberOfBytes, (PRUnichar*) buffer.get(), &outUnicodeLen);
rv = aUnicodeDecoder->Convert(aANSIString, &numberOfBytes, buffer.BeginWriting(), &outUnicodeLen);
static nsresult DoCharsetConversion(nsIUnicodeDecoder *aUnicodeDecoder,                                      const char* aANSIString, nsAString& aUnicodeString){  NS_ENSURE_TRUE(aUnicodeDecoder, NS_ERROR_FAILURE);  NS_ENSURE_TRUE(aANSIString, NS_ERROR_FAILURE);  nsresult rv;  PRInt32 numberOfBytes = strlen(aANSIString);  PRInt32 outUnicodeLen;  nsAutoString buffer;  rv = aUnicodeDecoder->GetMaxLength(aANSIString, numberOfBytes, &outUnicodeLen);  NS_ENSURE_SUCCESS(rv, rv);  buffer.SetCapacity(outUnicodeLen);  rv = aUnicodeDecoder->Convert(aANSIString, &numberOfBytes, (PRUnichar*) buffer.get(), &outUnicodeLen);  NS_ENSURE_SUCCESS(rv, rv);  buffer.SetLength(outUnicodeLen);  aUnicodeString = buffer;  return rv;}