char posix_locale[9];
char posix_locale[128];
nsUNIXCharset::GetDefaultCharsetForLocale(const PRUnichar* localeName, PRUnichar** _retValue){  nsCOMPtr<nsIPosixLocale> pPosixLocale;  nsString charset("ISO-8859-1"), localeNameAsString(localeName);  char posix_locale[9];  //  // convert the locale name  //  nsresult rv = nsComponentManager::CreateInstance(kPosixLocaleFactoryCID,nsnull,                                                   kIPosixLocaleIID,                                                   getter_AddRefs(pPosixLocale));  if (NS_FAILED(rv)) { *_retValue = charset.ToNewUnicode(); return rv; }  rv = pPosixLocale->GetPlatformLocale(&localeNameAsString,posix_locale,sizeof(posix_locale));  if (NS_FAILED(rv)) { *_retValue = charset.ToNewUnicode(); return rv; }  //  // convert from locale to charset  //  nsAutoString property_url("resource:/res/unixcharset.properties");   nsURLProperties *charset_properties = new nsURLProperties(property_url);    if (!charset_properties) { *_retValue=charset.ToNewUnicode(); return NS_ERROR_OUT_OF_MEMORY; }  nsAutoString locale_key("locale." OSTYPE ".");   locale_key.Append(posix_locale);    rv = charset_properties->Get(locale_key,charset);  if(NS_FAILED(rv)) {     locale_key="locale.all.";     locale_key.Append(posix_locale);     rv = charset_properties->Get(locale_key,charset);     if(NS_FAILED(rv)) { charset="ISO-8859-1";}  }  delete charset_properties;  *_retValue = charset.ToNewUnicode();	return rv;}