Back to index

lightning-sunbird  0.9+nobinonly
Functions
TestI18nCompatibility.cpp File Reference
#include <stdio.h>
#include "nsXPCOM.h"
#include "nsIComponentManager.h"
#include "nsISupports.h"
#include "nsIServiceManager.h"
#include "nsCOMPtr.h"
#include "nsReadableUtils.h"
#include "nsII18nCompatibility.h"

Go to the source code of this file.

Functions

static NS_DEFINE_CID (kI18nCompatibilityCID, NS_I18NCOMPATIBILITY_CID)
int main (int argc, char **argv)
 The Xalan testcases app.

Function Documentation

int main ( int  argc,
char **  argv 
)

The Xalan testcases app.

Definition at line 49 of file TestI18nCompatibility.cpp.

                                {
  nsresult rv;

  NS_InitXPCOM2(nsnull, nsnull, nsnull);

  nsCOMPtr<nsII18nCompatibility> I18nCompatibility =
      do_CreateInstance(kI18nCompatibilityCID, &rv);
  if (NS_SUCCEEDED(rv)) {
    PRUint16 csid = 0;
    PRUnichar *charsetUni = NULL;

    rv = I18nCompatibility->CSIDtoCharsetName(csid, &charsetUni);
    if (NS_SUCCEEDED(rv) && NULL != charsetUni) {
      nsString tempStr(charsetUni);
      char *tempCstr = ToNewCString(tempStr);

      nsMemory::Free(charsetUni);

      if (NULL != tempCstr) {
        printf("%us %s\n", csid, tempCstr);
        delete [] tempCstr;
      }
    }
  }
  else {
    cout << "error: CreateInstance\n";
  }

  cout << "done\n";

  return 0;
}

Here is the call graph for this function:

static NS_DEFINE_CID ( kI18nCompatibilityCID  ,
NS_I18NCOMPATIBILITY_CID   
) [static]