nsAutoString UILocaleName; UILocaleName.AssignWithConversion(cmdUI);
nsCAutoString UILocaleName(cmdUI);
static nsresult InstallGlobalLocale(nsICmdLineService *cmdLineArgs){    nsresult rv = NS_OK;    // check the pref first    nsCOMPtr<nsIPref> prefService(do_GetService(NS_PREF_CONTRACTID));    PRBool matchOS = PR_FALSE;    if (prefService)      prefService->GetBoolPref(kMatchOSLocalePref, &matchOS);    // match os locale    nsAutoString uiLang;    nsAutoString country;    if (matchOS) {      // compute lang and region code only when needed!      rv = getUILangCountry(uiLang, country);    }    nsXPIDLCString cmdUI;    rv = cmdLineArgs->GetCmdLineValue(UILOCALE_CMD_LINE_ARG, getter_Copies(cmdUI));    if (NS_SUCCEEDED(rv)){        if (cmdUI) {            nsAutoString UILocaleName;            UILocaleName.AssignWithConversion(cmdUI);            nsCOMPtr<nsIXULChromeRegistry> chromeRegistry = do_GetService(NS_CHROMEREGISTRY_CONTRACTID, &rv);            if (chromeRegistry)                rv = chromeRegistry->SelectLocale(UILocaleName.get(), PR_FALSE);        }    }    // match OS when no cmdline override    if (!cmdUI && matchOS) {      nsCOMPtr<nsIXULChromeRegistry> chromeRegistry = do_GetService(NS_CHROMEREGISTRY_CONTRACTID, &rv);      if (chromeRegistry) {        chromeRegistry->SetRuntimeProvider(PR_TRUE);        rv = chromeRegistry->SelectLocale(uiLang.get(), PR_FALSE);      }    }    nsXPIDLCString cmdContent;    rv = cmdLineArgs->GetCmdLineValue(CONTENTLOCALE_CMD_LINE_ARG, getter_Copies(cmdContent));    if (NS_SUCCEEDED(rv)){        if (cmdContent) {            nsAutoString ContentLocaleName;            ContentLocaleName.AssignWithConversion(cmdContent);            nsCOMPtr<nsIXULChromeRegistry> chromeRegistry = do_GetService(NS_CHROMEREGISTRY_CONTRACTID, &rv);            if(chromeRegistry)                rv = chromeRegistry->SelectLocale(ContentLocaleName.get(), PR_FALSE);        }    }    // match OS when no cmdline override    if (!cmdContent && matchOS) {      nsCOMPtr<nsIXULChromeRegistry> chromeRegistry = do_GetService(NS_CHROMEREGISTRY_CONTRACTID, &rv);      if (chromeRegistry) {        chromeRegistry->SetRuntimeProvider(PR_TRUE);                rv = chromeRegistry->SelectLocale(country.get(), PR_FALSE);      }    }    return NS_OK;}