res = ConvertFromUnicode(NS_ConvertASCIItoUCS2(to_charset), outString, outBuffer);
res = ConvertFromUnicode(to_charset, outString, outBuffer);
static PRInt32 INTL_ConvertCharset(const char* from_charset, const char* to_charset,                                   const char* inBuffer, const PRInt32 inLength,                                   char** outBuffer, PRInt32* outLength){  nsresult res;  // invalid input  if (nsnull == from_charset || nsnull == to_charset ||       '\0' == *from_charset || '\0' == *to_charset || nsnull == inBuffer)     return -1;  // from to identical  if (!nsCRT::strcasecmp(from_charset, to_charset))    return -1;  // us-ascii is a subset of utf-8  if ((!nsCRT::strcasecmp(from_charset, "us-ascii") && !nsCRT::strcasecmp(to_charset, "UTF-8")) ||      (!nsCRT::strcasecmp(from_charset, "UTF-8") && !nsCRT::strcasecmp(to_charset, "us-ascii")))    return -1;  nsAutoString outString;  nsAutoString aCharset; aCharset.AssignWithConversion(from_charset);    res = ConvertToUnicode(aCharset, inBuffer, outString);  // known bug in 4.x, it mixes Shift_JIS (or EUC-JP) and ISO-2022-JP in vCard fields  if (NS_ERROR_MODULE_UCONV == NS_ERROR_GET_MODULE(res)) {    if (aCharset.EqualsIgnoreCase("ISO-2022-JP")) {      aCharset.AssignWithConversion("Shift_JIS");      res = ConvertToUnicode(aCharset, inBuffer, outString);      if (NS_ERROR_MODULE_UCONV == NS_ERROR_GET_MODULE(res)) {        aCharset.AssignWithConversion("EUC-JP");        res = ConvertToUnicode(aCharset, inBuffer, outString);      }    }  }  if (NS_SUCCEEDED(res)) {    res = ConvertFromUnicode(NS_ConvertASCIItoUCS2(to_charset), outString, outBuffer);    if (NS_SUCCEEDED(res)) {      *outLength = nsCRT::strlen(*outBuffer);    }  }  return NS_SUCCEEDED(res) ? 0 : -1;}