Merge branch 'master' into msbuilddll2
[mono.git] / mono / metadata / locales.c
index 1474a105737e7086789fbef0d35708ce50c0c086..7fffad9cc8c5bf8206e0b34cefc24362c19d081a 100644 (file)
@@ -306,28 +306,6 @@ construct_region (MonoRegionInfo *this, const RegionInfoEntry *ri)
        return TRUE;
 }
 
-static gboolean
-construct_culture_from_specific_name (MonoCultureInfo *ci, gchar *name)
-{
-       const CultureInfoEntry *entry;
-       const CultureInfoNameEntry *ne;
-
-       MONO_ARCH_SAVE_REGS;
-
-       ne = mono_binary_search (name, culture_name_entries, NUM_CULTURE_ENTRIES,
-                       sizeof (CultureInfoNameEntry), culture_name_locator);
-
-       if (ne == NULL)
-               return FALSE;
-
-       entry = &culture_entries [ne->culture_entry_index];
-
-       if (entry)
-               return construct_culture (ci, entry);
-       else
-               return FALSE;
-}
-
 static const CultureInfoEntry*
 culture_info_entry_from_lcid (int lcid)
 {
@@ -478,6 +456,9 @@ get_current_locale_name (void)
        p = strchr (locale, '@');
        if (p != NULL)
                *p = 0;
+       p = strchr (locale, '_');
+       if (p != NULL)
+               *p = '-';
 
        ret = g_ascii_strdown (locale, -1);
        g_free (locale);
@@ -485,22 +466,22 @@ get_current_locale_name (void)
        return ret;
 }
 
-MonoBoolean
-ves_icall_System_Globalization_CultureInfo_construct_internal_locale_from_current_locale (MonoCultureInfo *ci)
+MonoString*
+ves_icall_System_Globalization_CultureInfo_get_current_locale_name (void)
 {
        gchar *locale;
-       gboolean ret;
+       MonoString* ret;
+       MonoDomain *domain;
 
        MONO_ARCH_SAVE_REGS;
 
        locale = get_current_locale_name ();
        if (locale == NULL)
-               return FALSE;
+               return NULL;
 
-       ret = construct_culture_from_specific_name (ci, locale);
+       domain = mono_domain_get ();
+       ret = mono_string_new (domain, locale);
        g_free (locale);
-       ci->is_read_only = TRUE;
-       ci->use_user_override = TRUE;
 
        return ret;
 }
@@ -542,7 +523,7 @@ ves_icall_System_Globalization_CultureInfo_construct_internal_locale_from_name (
 
        return construct_culture (this, &culture_entries [ne->culture_entry_index]);
 }
-
+/*
 MonoBoolean
 ves_icall_System_Globalization_CultureInfo_construct_internal_locale_from_specific_name (MonoCultureInfo *ci,
                MonoString *name)
@@ -558,7 +539,7 @@ ves_icall_System_Globalization_CultureInfo_construct_internal_locale_from_specif
 
        return ret;
 }
-
+*/
 MonoBoolean
 ves_icall_System_Globalization_RegionInfo_construct_internal_region_from_lcid (MonoRegionInfo *this,
                gint lcid)