};
}
struct cs_info * get_current_cs(const char * es) {  struct cs_info *ccs;  nsCOMPtr<nsIUnicodeEncoder> encoder;   nsCOMPtr<nsIUnicodeDecoder> decoder;   nsCOMPtr<nsICaseConversion> caseConv;  nsresult rv;  nsCOMPtr<nsICharsetConverterManager> ccm = do_GetService(kCharsetConverterManagerCID, &rv);  if (NS_FAILED(rv))    return nsnull;  rv = ccm->GetUnicodeEncoder(es, getter_AddRefs(encoder));  if (encoder && NS_SUCCEEDED(rv))    encoder->SetOutputErrorBehavior(encoder->kOnError_Replace, nsnull, '?');  if (NS_FAILED(rv))    return nsnull;  rv = ccm->GetUnicodeDecoder(es, getter_AddRefs(decoder));  caseConv = do_GetService(kUnicharUtilCID, &rv);  if (NS_FAILED(rv))    return nsnull;  ccs = (struct cs_info *) malloc(0xff * sizeof(cs_info));  PRInt32 charLength = 256;  PRInt32 uniLength = 512;  char *source = (char *)malloc(charLength * sizeof(char));  PRUnichar *uni = (PRUnichar *)malloc(uniLength * sizeof(PRUnichar));  char *lower = (char *)malloc(charLength * sizeof(char));  char *upper = (char *)malloc(charLength * sizeof(char));  // Create a long string of all chars.  unsigned int i;  for (i = 0x00; i <= 0xff ; ++i) {    source[i] = i;  }  // Convert this long string to unicode  rv = decoder->Convert(source, &charLength, uni, &uniLength);  // Do case conversion stuff, and convert back.  caseConv->ToUpper(uni, uni, uniLength);  encoder->Convert(uni, &uniLength, upper, &charLength);  uniLength = 512;  charLength = 256;  rv = decoder->Convert(source, &charLength, uni, &uniLength);  caseConv->ToLower(uni, uni, uniLength);  encoder->Convert(uni, &uniLength, lower, &charLength);  // Store  for (i = 0x00; i <= 0xff ; ++i) {    ccs[i].cupper = upper[i];    ccs[i].clower = lower[i];        if (ccs[i].clower != (unsigned char)i)      ccs[i].ccase = true;    else      ccs[i].ccase = false;        }  free(source);  free(uni);  free(lower);  free(upper);  return ccs;};