PR_AtomicIncrement(&g_InstanceCount);
nsMacCharset::nsMacCharset(){  NS_INIT_REFCNT();  PR_AtomicIncrement(&g_InstanceCount);  PR_AtomicIncrement(&gCnt);    // XXX we should make the following block critical section  if(gInfo == nsnull)   {	  nsAutoString propertyURL; propertyURL.AssignWithConversion("resource:/res/maccharset.properties");	  nsURLProperties *info = new nsURLProperties( propertyURL );	  NS_ASSERTION(info , "cannot open properties file");	  gInfo = info;  }  if( gInfo ) { 	  long ret = ::GetScriptManagerVariable(smRegionCode);	  PRInt32 reg = (PRInt32)(ret & 0x00FFFF); 	  nsAutoString regionKey; regionKey.AssignWithConversion("region.");	  regionKey.AppendInt(reg, 10);	  	  nsresult res = gInfo->Get(regionKey, mCharset);	  if(NS_FAILED(res)) {		  ret = ::GetScriptManagerVariable(smSysScript);		  PRInt32 script = (PRInt32)(ret & 0x00FFFF);		  nsAutoString scriptKey; scriptKey.AssignWithConversion("script.");		  scriptKey.AppendInt(script, 10);	 	  nsresult res = gInfo->Get(scriptKey, mCharset);	      if(NS_FAILED(res)) {	      	  mCharset.AssignWithConversion("x-mac-roman");		  }   	  }	    } else {  	mCharset.AssignWithConversion("x-mac-roman");  }}